This method overrides the superclass method of the same name
in order to add catalog entries back to the controlling
XMLCatalog instance. In this way, we can add classpath lookup
for these entries.
When we add an external catalog file, the entries inside it
get parsed by this method. Therefore, we override it to add
each of them back to the controlling XMLCatalog instance. This
is done by performing a callback to the ApacheCatalogResolver,
which in turn calls the XMLCatalog.
XMLCatalog currently only understands PUBLIC
and URI
entry types, so we ignore the other types.
int type = entry.getEntryType();
if (type == PUBLIC) {
String publicid = PublicId.normalize(entry.getEntryArg(0));
String systemid = normalizeURI(entry.getEntryArg(1));
if (resolver == null) {
catalogManager.debug
.message(1, "Internal Error: null ApacheCatalogResolver");
} else {
resolver.addPublicEntry(publicid, systemid, base);
}
} else if (type == URI) {
String uri = normalizeURI(entry.getEntryArg(0));
String altURI = normalizeURI(entry.getEntryArg(1));
if (resolver == null) {
catalogManager.debug
.message(1, "Internal Error: null ApacheCatalogResolver");
} else {
resolver.addURIEntry(uri, altURI, base);
}
}
super.addEntry(entry);