donaldp     2002/09/09 05:37:38

  Modified:    info/src/java/org/apache/avalon/framework/info
                        EntryDescriptor.java
               info/src/java/org/apache/avalon/framework/tools/infobuilder
                        XMLInfoCreator.java componentinfo.dtd
  Log:
  Allow entrys to have sub-attributes
  
  Revision  Changes    Path
  1.3       +12 -3     
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java
  
  Index: EntryDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EntryDescriptor.java      8 Sep 2002 04:57:05 -0000       1.2
  +++ EntryDescriptor.java      9 Sep 2002 12:37:37 -0000       1.3
  @@ -8,6 +8,7 @@
   package org.apache.avalon.framework.info;
   
   import java.io.Serializable;
  +import java.util.Properties;
   
   /**
    * A descriptor that describes a value that must be placed
  @@ -22,10 +23,16 @@
    * for a list of widely recognized entry values and a recomended
    * naming scheme for other attributes.</p>
    *
  + * <p>Also associated with each entry is a set of arbitrary
  + * attributes that can be used to store extra information
  + * about entry. See {@link ComponentDescriptor} for example
  + * of how to declare the container specific attributes.</p>
  + *
    * @author <a href="mailto:peter at apache.org">Peter Donald</a>
    * @version $Revision$ $Date$
    */
   public final class EntryDescriptor
  +    extends FeatureDescriptor
       implements Serializable
   {
       /**
  @@ -48,13 +55,15 @@
        */
       public EntryDescriptor( final String key,
                               final String type,
  -                            final boolean optional )
  +                            final boolean optional,
  +                            final Properties attributes )
       {
  +        super( attributes );
  +
           if( null == key )
           {
               throw new NullPointerException( "key" );
           }
  -
           if( null == type )
           {
               throw new NullPointerException( "type" );
  
  
  
  1.7       +4 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoCreator.java
  
  Index: XMLInfoCreator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoCreator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLInfoCreator.java       8 Sep 2002 05:23:40 -0000       1.6
  +++ XMLInfoCreator.java       9 Sep 2002 12:37:37 -0000       1.7
  @@ -292,8 +292,10 @@
           final String type = config.getAttribute( "type" );
           final boolean optional =
               config.getAttributeAsBoolean( "optional", false );
  +        final Properties attributes =
  +            buildAttributes( config.getChild( "attributes" ) );
   
  -        return new EntryDescriptor( key, type, optional );
  +        return new EntryDescriptor( key, type, optional, attributes );
       }
   
       /**
  
  
  
  1.4       +2 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/componentinfo.dtd
  
  Index: componentinfo.dtd
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/componentinfo.dtd,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- componentinfo.dtd 8 Sep 2002 04:32:51 -0000       1.3
  +++ componentinfo.dtd 9 Sep 2002 12:37:37 -0000       1.4
  @@ -93,7 +93,7 @@
                to the value specified in the name attribute of service element
   service-ref  the service that is required
   -->
  -<!ELEMENT dependency  (key?,service-ref,attributes?) >
  +<!ELEMENT dependency  (key?,service-ref,attributes*) >
     <!ATTLIST dependency optional CDATA #IMPLIED >
     <!ELEMENT key        (#PCDATA) >
   
  @@ -140,7 +140,7 @@
   value             the value of entry.
   optional     is entry optional
   -->
  -<!ELEMENT entry   EMPTY >
  +<!ELEMENT entry   (attributes*) >
     <!ATTLIST entry
          key CDATA #REQUIRED
          type CDATA #REQUIRED
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to