/** * Find a ResourceLocation instance for the given publicId. * * @param publicId the publicId of the Resource for which local information * is required. * @return a ResourceLocation instance with information on the local location * of the Resource or null if no such information is available. */ private ResourceLocation findMatchingEntry(String publicId) { return getElements().stream() .filter(e -> e.getPublicId().equals(publicId)).findFirst() .orElse(null); }
/** * Creates the nested <code><dtd></code> element. Not * allowed if this catalog is itself a reference to another * catalog -- that is, a catalog cannot both refer to another * <em>and</em> contain elements or other attributes. * * @param dtd the information about the PUBLIC resource mapping to * be added to the catalog * @exception BuildException if this is a reference and no nested * elements are allowed. */ public void addDTD(ResourceLocation dtd) throws BuildException { if (isReference()) { throw noChildrenAllowed(); } getElements().addElement(dtd); setChecked(false); }
/** * Loads a nested <code><xmlcatalog></code> into our * definition. Not allowed if this catalog is itself a reference * to another catalog -- that is, a catalog cannot both refer to * another <em>and</em> contain elements or other attributes. * * @param catalog Nested XMLCatalog */ public void addConfiguredXMLCatalog(XMLCatalog catalog) { if (isReference()) { throw noChildrenAllowed(); } // Add all nested elements to our catalog getElements().addAll(catalog.getElements()); // Append the classpath of the nested catalog Path nestedClasspath = catalog.getClasspath(); createClasspath().append(nestedClasspath); // Append the catalog path of the nested catalog Path nestedCatalogPath = catalog.getCatalogPath(); createCatalogPath().append(nestedCatalogPath); setChecked(false); }