ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata Modeller.java ModelElement.java
Date Thu, 21 Mar 2002 10:22:48 GMT
donaldp     02/03/21 02:22:48

  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata
                        Modeller.java ModelElement.java
  Log:
  Add in proposals for replacement of the Avalon Configuration system
  
  Revision  Changes    Path
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata/Modeller.java
  
  Index: Modeller.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.api.metadata;
  
  /**
   * The Modeller interface specifies that the implementing object
   * wishes to handle its own configuration stage. In which case the
   * object is passed the ModelElement representing itself and it uses
   * the element to configure itself.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/03/21 10:22:48 $
   * @see ModelElement
   */
  public interface Modeller
  {
      /**
       * Pass the object a read-only instance of it's own
       * model.
       *
       * @param element the ModelElement representing object
       */
      void model( ModelElement element );
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata/ModelElement.java
  
  Index: ModelElement.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.api.metadata;
  
  /**
   * A ModelElement represents the data necessary to configure
   * the task or sub-object. It usually represents an XML element in a
   * build file and has similar features to XML elements.
   *
   * <p>It has a set of un-ordered attributes with each attribute mapping
   * a key to a value. The ModelElement can also have either a set of ordered
   * sub-elements or text content (one or the other - not both).</p>
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/03/21 10:22:48 $
   */
  public class ModelElement
  {
      /**
       * Return an array containing all the child <code>ModelElement</code>s
       * that are contained within this <code>ModelElement</code>. If this method
       * returns an array containing 1 or more elements then it must return null
       * for getContent() method.
       *
       * @todo determine whether we return null or an empty array when no
       *       child elements.
       * @return all the child <code>ModelElement</code>s
       * @see #getContent()
       */
      public ModelElement[] getChildren()
      {
          return null;
      }
  
      /**
       * Return an array containing the names of all the attributes stored
       * in this <code>ModelElement</code>. The user can then pass these
       * parameters into the getAttribute() method of this class to get the
       * value of the attribute.
       *
       * @return an array of the attribute names
       * @see #getAttribute(String)
       */
      public String[] getAttributeNames()
      {
          return null;
      }
  
      /**
       * Get the value of the attribute passed in.
       * If no such attribute exists return null.
       *
       * @param name the name of the attribute to retrieve value for
       * @return the value of the attribute with specified name or null
       *         if no such element.
       */
      public String getAttribute( final String name )
      {
          return null;
      }
  
      /**
       * Retrieve the content of this element if any. Will return
       * null if no content available. Note it is invalid for this
       * method to return a non-null value and the getChildren()
       * method to return an array of 1 or more child elements.
       *
       * @return the content value if any, else null
       * @see #getChildren()
       */
      public String getContent()
      {
          return null;
      }
  }
  
  
  

--
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