/** * 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); }
/** * Allows nested classpath elements. 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. * * @return a Path instance to be configured. */ public Path createClasspath() { if (isReference()) { throw noChildrenAllowed(); } if (this.classpath == null) { this.classpath = new Path(getProject()); } setChecked(false); return this.classpath.createPath(); }
/** Creates a nested <code><catalogpath></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. * * @return a path to be configured as the catalog path. * @exception BuildException * if this is a reference and no nested elements are allowed. */ public Path createCatalogPath() { if (isReference()) { throw noChildrenAllowed(); } if (this.catalogPath == null) { this.catalogPath = new Path(getProject()); } setChecked(false); return this.catalogPath.createPath(); }
/** * 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); }