donaldp     2002/09/13 08:54:09

  Modified:    info/src/java/org/apache/avalon/framework/info
                        ComponentDescriptor.java ContextDescriptor.java
                        DependencyDescriptor.java EntryDescriptor.java
                        FeatureDescriptor.java LoggerDescriptor.java
                        ServiceDescriptor.java
               info/src/java/org/apache/avalon/framework/tools/infobuilder
                        XMLInfoCreator.java
  Added:       info/src/java/org/apache/avalon/framework/info Tag.java
  Removed:     info/src/java/org/apache/avalon/framework/info
                        TagDescriptor.java
  Log:
  TagDescriptor --> Tag
  
  Revision  Changes    Path
  1.6       +4 -4      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentDescriptor.java
  
  Index: ComponentDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentDescriptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ComponentDescriptor.java  13 Sep 2002 15:42:12 -0000      1.5
  +++ ComponentDescriptor.java  13 Sep 2002 15:54:08 -0000      1.6
  @@ -39,8 +39,8 @@
    * ...
    *
    * ComponentDescriptor cd = ...;
  - * TagDescriptor lifestyle = cd.getTag( LIFESTYLE );
  - * TagDescriptor scope = cd.getTag( SCOPE );
  + * Tag lifestyle = cd.getTag( LIFESTYLE );
  + * Tag scope = cd.getTag( SCOPE );
    * </pre>
    *
    * @author <a href="mailto:peter at apache.org">Peter Donald</a>
  @@ -63,7 +63,7 @@
   
       public ComponentDescriptor( final String name,
                                   final String implementationKey,
  -                                final TagDescriptor[] tags )
  +                                final Tag[] tags )
       {
           super( tags );
           if( null == name )
  
  
  
  1.8       +2 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java
  
  Index: ContextDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContextDescriptor.java    13 Sep 2002 15:42:12 -0000      1.7
  +++ ContextDescriptor.java    13 Sep 2002 15:54:08 -0000      1.8
  @@ -48,7 +48,7 @@
        */
       public ContextDescriptor( final String type,
                                 final EntryDescriptor[] entrys,
  -                              final TagDescriptor[] tags )
  +                              final Tag[] tags )
       {
           super( tags );
   
  
  
  
  1.7       +2 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java
  
  Index: DependencyDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DependencyDescriptor.java 13 Sep 2002 15:42:12 -0000      1.6
  +++ DependencyDescriptor.java 13 Sep 2002 15:54:08 -0000      1.7
  @@ -56,7 +56,7 @@
       public DependencyDescriptor( final String key,
                                    final String service,
                                    final boolean optional,
  -                                 final TagDescriptor[] tags )
  +                                 final Tag[] tags )
       {
           super( tags );
   
  
  
  
  1.5       +2 -2      
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EntryDescriptor.java      13 Sep 2002 15:42:12 -0000      1.4
  +++ EntryDescriptor.java      13 Sep 2002 15:54:08 -0000      1.5
  @@ -55,7 +55,7 @@
       public EntryDescriptor( final String key,
                               final String type,
                               final boolean optional,
  -                            final TagDescriptor[] tags )
  +                            final Tag[] tags )
       {
           super( tags );
   
  
  
  
  1.4       +6 -6      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/FeatureDescriptor.java
  
  Index: FeatureDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/FeatureDescriptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FeatureDescriptor.java    13 Sep 2002 15:42:12 -0000      1.3
  +++ FeatureDescriptor.java    13 Sep 2002 15:54:08 -0000      1.4
  @@ -25,14 +25,14 @@
       /**
        * The arbitrary set of tags associated with Component.
        */
  -    private final TagDescriptor[] m_tags;
  +    private final Tag[] m_tags;
   
       /**
        * Create a FeatureDescriptor with specific set of tags.
        *
        * @param tags the tags
        */
  -    protected FeatureDescriptor( final TagDescriptor[] tags )
  +    protected FeatureDescriptor( final Tag[] tags )
       {
           if( null == tags )
           {
  @@ -47,7 +47,7 @@
        *
        * @return the tags associated with descriptor.
        */
  -    public TagDescriptor[] getTags()
  +    public Tag[] getTags()
       {
           return m_tags;
       }
  @@ -57,11 +57,11 @@
        *
        * @return the tag with specified name.
        */
  -    public TagDescriptor getTag( final String name )
  +    public Tag getTag( final String name )
       {
           for( int i = 0; i < m_tags.length; i++ )
           {
  -            final TagDescriptor tag = m_tags[ i ];
  +            final Tag tag = m_tags[ i ];
               if( tag.getName().equals( name ) )
               {
                   return tag;
  
  
  
  1.5       +2 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java
  
  Index: LoggerDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LoggerDescriptor.java     13 Sep 2002 15:42:12 -0000      1.4
  +++ LoggerDescriptor.java     13 Sep 2002 15:54:08 -0000      1.5
  @@ -31,7 +31,7 @@
        * @exception NullPointerException if name argument is null
        */
       public LoggerDescriptor( final String name,
  -                             final TagDescriptor[] tags )
  +                             final Tag[] tags )
       {
           super( tags );
           if( null == name )
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java
  
  Index: ServiceDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServiceDescriptor.java    13 Sep 2002 15:42:12 -0000      1.5
  +++ ServiceDescriptor.java    13 Sep 2002 15:54:08 -0000      1.6
  @@ -43,7 +43,7 @@
        * @param tags the tags of service
        */
       public ServiceDescriptor( final String implementationKey,
  -                              final TagDescriptor[] tags )
  +                              final Tag[] tags )
       {
           super( tags );
   
  
  
  
  1.1                  
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/Tag.java
  
  Index: Tag.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.avalon.framework.info;
  
  import java.io.Serializable;
  import java.util.Properties;
  
  /**
   * Tags are the mechanism via which the Avalon Component model
   * is extended. Each tag is made up of
   * <ul>
   *   <li>name: the name of the tag</li>
   *   <li>parameters: a set of key-value pairs specifying parameters for 
tag</li>
   * </ul>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/09/13 15:54:08 $
   */
  public final class Tag
      implements Serializable
  {
      private static final String[] EMPTY_SET = new String[ 0 ];
  
      /**
       * The name of the tag.
       */
      private final String m_name;
  
      /**
       * The arbitrary set of parameters associated with the tag.
       */
      private final Properties m_parameters;
  
      /**
       * Create a tag with specified name and parameters.
       *
       * @param name the tag name
       * @param parameters the tag parameters
       */
      public Tag( final String name,
                            final Properties parameters )
      {
          if( null == name )
          {
              throw new NullPointerException( "name" );
          }
          if( null == parameters )
          {
              throw new NullPointerException( "parameters" );
          }
  
          m_name = name;
          m_parameters = parameters;
      }
  
      /**
       * Return the name of the tag.
       *
       * @return the name of the tag.
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Return the parameter for specified key.
       *
       * @return the parameter for specified key.
       */
      public String getParameter( final String key )
      {
          if( null == m_parameters )
          {
              return null;
          }
          else
          {
              return m_parameters.getProperty( key );
          }
      }
  
      /**
       * Return the parameter for specified key, or defaultValue if unspecified.
       *
       * @return the parameter for specified key, or defaultValue if 
unspecified.
       */
      public String getParameter( final String key,
                                  final String defaultValue )
      {
          if( null == m_parameters )
          {
              return defaultValue;
          }
          else
          {
              return m_parameters.getProperty( key, defaultValue );
          }
      }
  
      /**
       * Returns an array of parameter names available under this tag.
       *
       * @return an array of parameter names available under this tag.
       */
      public String[] getParameterNames()
      {
          if( null == m_parameters )
          {
              return EMPTY_SET;
          }
          else
          {
              return (String[])m_parameters.keySet().toArray( EMPTY_SET );
          }
      }
  }
  
  
  
  1.9       +13 -13    
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLInfoCreator.java       13 Sep 2002 15:42:12 -0000      1.8
  +++ XMLInfoCreator.java       13 Sep 2002 15:54:09 -0000      1.9
  @@ -22,7 +22,7 @@
   import org.apache.avalon.framework.info.EntryDescriptor;
   import org.apache.avalon.framework.info.LoggerDescriptor;
   import org.apache.avalon.framework.info.ServiceDescriptor;
  -import org.apache.avalon.framework.info.TagDescriptor;
  +import org.apache.avalon.framework.info.Tag;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.xml.sax.InputSource;
   
  @@ -158,7 +158,7 @@
           throws ConfigurationException
       {
           final String name = logger.getAttribute( "name", "" );
  -        final TagDescriptor[] tags = buildTags( logger );
  +        final Tag[] tags = buildTags( logger );
           return new LoggerDescriptor( name, tags );
       }
   
  @@ -206,7 +206,7 @@
           final boolean optional =
               dependency.getAttributeAsBoolean( "optional", false );
   
  -        final TagDescriptor[] tags = buildTags( dependency );
  +        final Tag[] tags = buildTags( dependency );
   
           String key = dependency.getAttribute( "key", null );
   
  @@ -246,7 +246,7 @@
           final EntryDescriptor[] entrys =
               buildEntrys( context.getChildren( "entry" ) );
   
  -        final TagDescriptor[] tags = buildTags( context );
  +        final Tag[] tags = buildTags( context );
   
           final String type =
               context.getAttribute( "type",
  @@ -291,7 +291,7 @@
           final String type = config.getAttribute( "type" );
           final boolean optional =
               config.getAttributeAsBoolean( "optional", false );
  -        final TagDescriptor[] tags = buildTags( config );
  +        final Tag[] tags = buildTags( config );
   
           return new EntryDescriptor( key, type, optional, tags );
       }
  @@ -331,7 +331,7 @@
           throws ConfigurationException
       {
           final String implementationKey = service.getAttribute( "type" );
  -        final TagDescriptor[] tags = buildTags( service );
  +        final Tag[] tags = buildTags( service );
           return new ServiceDescriptor( implementationKey, tags );
       }
   
  @@ -341,7 +341,7 @@
        * @param config the tags config
        * @return the set of tags
        */
  -    private TagDescriptor[] buildTags( final Configuration config )
  +    private Tag[] buildTags( final Configuration config )
           throws ConfigurationException
       {
           final ArrayList tags = new ArrayList();
  @@ -350,11 +350,11 @@
           for( int i = 0; i < tagConfigs.length; i++ )
           {
               final Configuration tagConfig = tagConfigs[ i ];
  -            final TagDescriptor tag = buildTag( tagConfig );
  +            final Tag tag = buildTag( tagConfig );
               tags.add( tag );
           }
   
  -        return (TagDescriptor[])tags.toArray( new TagDescriptor[ tags.size() 
] );
  +        return (Tag[])tags.toArray( new Tag[ tags.size() ] );
       }
   
       /**
  @@ -364,12 +364,12 @@
        * @return the new Tag
        * @throws ConfigurationException if unable to build tag due to 
malformed xml
        */
  -    private TagDescriptor buildTag( Configuration config )
  +    private Tag buildTag( Configuration config )
           throws ConfigurationException
       {
           final String name = config.getAttribute( "name" );
           final Properties parameters = buildParameters( config );
  -        return new TagDescriptor( name, parameters );
  +        return new Tag( name, parameters );
       }
   
       /**
  @@ -406,7 +406,7 @@
       {
           final String name = config.getAttribute( "name", null );
           final String type = config.getAttribute( "type" );
  -        final TagDescriptor[] tags = buildTags( config );
  +        final Tag[] tags = buildTags( config );
   
           return new ComponentDescriptor( name, type, tags );
       }
  
  
  

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

Reply via email to