Search in sources :

Example 1 with ICatalog

use of org.eclipse.wst.json.core.schema.catalog.ICatalog in project webtools.sourceediting by eclipse.

the class Catalog method addEntriesFromCatalog.

public void addEntriesFromCatalog(ICatalog catalog) {
    try {
        setNotificationEnabled(false);
        if (catalog != null) {
            ICatalogElement[] entries = ((Catalog) catalog).getCatalogElements();
            for (int i = 0; i < entries.length; i++) {
                CatalogElement clone = (CatalogElement) ((CatalogElement) entries[i]).clone();
                addCatalogElement(clone);
            }
        } else {
            Logger.log(Logger.ERROR, // $NON-NLS-1$
            "argument was null in Catalog.addEntriesFromCatalog");
        }
    } finally {
        setNotificationEnabled(true);
    }
    internalResolver = null;
    notifyChanged();
}
Also used : ICatalogElement(org.eclipse.wst.json.core.schema.catalog.ICatalogElement) ICatalogElement(org.eclipse.wst.json.core.schema.catalog.ICatalogElement) IDelegateCatalog(org.eclipse.wst.json.core.schema.catalog.IDelegateCatalog) ICatalog(org.eclipse.wst.json.core.schema.catalog.ICatalog) INextCatalog(org.eclipse.wst.json.core.schema.catalog.INextCatalog)

Example 2 with ICatalog

use of org.eclipse.wst.json.core.schema.catalog.ICatalog in project webtools.sourceediting by eclipse.

the class Catalog method resolveSubordinateCatalogs.

protected String resolveSubordinateCatalogs(int entryType, String publicId, String systemId) throws MalformedURLException, IOException {
    String result = null;
    INextCatalog[] nextCatalogs = getNextCatalogs();
    for (int i = 0; i < nextCatalogs.length; i++) {
        INextCatalog nextCatalog = nextCatalogs[i];
        ICatalog catalog = nextCatalog.getReferencedCatalog();
        if (catalog != null) {
            switch(entryType) {
                case ICatalogEntry.ENTRY_TYPE_SCHEMA:
                    result = catalog.resolveSchema(systemId);
                    break;
                default:
                    break;
            }
            if (result != null) {
                return result;
            }
        }
    }
    return null;
}
Also used : INextCatalog(org.eclipse.wst.json.core.schema.catalog.INextCatalog) ICatalog(org.eclipse.wst.json.core.schema.catalog.ICatalog)

Aggregations

ICatalog (org.eclipse.wst.json.core.schema.catalog.ICatalog)2 INextCatalog (org.eclipse.wst.json.core.schema.catalog.INextCatalog)2 ICatalogElement (org.eclipse.wst.json.core.schema.catalog.ICatalogElement)1 IDelegateCatalog (org.eclipse.wst.json.core.schema.catalog.IDelegateCatalog)1