ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types XMLCatalog.java
Date Fri, 19 Apr 2002 03:13:36 GMT
ehatcher    02/04/18 20:13:36

  Modified:    src/main/org/apache/tools/ant/types XMLCatalog.java
  Log:
  Add nested XMLCatalog support, which will make grouping them in a build file a bit more
flexible.  This hasn't been tested other than to try that
  <xmlcatalog id="one"/>
  <xmlcatalog id="two">
    <xmlcatalog refid="one"/>
  </xmlcatalog>
  worked, but its straightforward enough that it (hopefully) won't break anything :)
  
  Revision  Changes    Path
  1.7       +21 -3     jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java
  
  Index: XMLCatalog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLCatalog.java	15 Apr 2002 12:11:50 -0000	1.6
  +++ XMLCatalog.java	19 Apr 2002 03:13:36 -0000	1.7
  @@ -83,15 +83,15 @@
    * <p>
    * The object implemention <code>sometask</code> must provide a method called
    * <code>createCatalog</code> which returns an instance of 
  - * <code>XCatalog</code>. Nested dtd and entity definitions are handled by

  - * the XCatalog object and must be labeled <code>dtd</code> and 
  + * <code>XMLCatalog</code>. Nested DTD and entity definitions are handled by
  + * the XMLCatalog object and must be labeled <code>dtd</code> and
    * <code>entity</code> respectively.</p>
    *
    * <p>Possible future extension could allow a catalog file instead of nested
    * elements, or use Norman Walsh's entity resolver from xml-commons</p>
    *
    * @author  dIon Gillard
  - * @version $Id: XMLCatalog.java,v 1.6 2002/04/15 12:11:50 conor Exp $
  + * @version $Id: XMLCatalog.java,v 1.7 2002/04/19 03:13:36 ehatcher Exp $
    */
   public class XMLCatalog extends DataType implements Cloneable, EntityResolver {
       /** File utilities instance */
  @@ -152,6 +152,24 @@
        */
       public void addEntity(DTDLocation dtd) throws BuildException {
           addDTD(dtd);
  +    }
  +
  +    /**
  +     * Loads a nested XMLCatalog into our definition
  +     *
  +     * @param catalog Nested XMLCatalog
  +     */
  +    public void addConfiguredXMLCatalog(XMLCatalog catalog) {
  +        if (isReference()) {
  +            throw noChildrenAllowed();
  +        }
  +
  +        Vector newElements = catalog.getElements();
  +        Vector ourElements = getElements();
  +        Enumeration enum = newElements.elements();
  +        while (enum.hasMoreElements()) {
  +            ourElements.add(enum.nextElement());
  +        }
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message