avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/meta/src/java/org/apache/avalon/meta/verifier ComponentVerifier.java Resources.properties VerifyException.java package.html
Date Mon, 10 Mar 2003 15:33:46 GMT
mcconnell    2003/03/10 07:33:46

  Modified:    meta/src/java/org/apache/avalon/meta/model/builder
                        XMLProfileCreator.java
  Removed:     meta     .cvsignore LICENSE.TXT WARNING.txt
                        ant.properties.sample build.xml default.properties
               meta/src/etc checkstyle.properties project.mf
               meta/src/java/org/apache/avalon/meta
                        ConfigurationBuilder.java DTDInfo.java
                        DTDResolver.java blockinfo.dtd package.html
                        service.dtd type.dtd
               meta/src/java/org/apache/avalon/meta/info
                        ContextDescriptor.java DependencyDescriptor.java
                        Descriptor.java EntryDescriptor.java
                        ExtensionDescriptor.java InfoDescriptor.java
                        LoggerDescriptor.java ReferenceDescriptor.java
                        Resources.properties Service.java
                        ServiceDescriptor.java StageDescriptor.java
                        Type.java package.html
               meta/src/java/org/apache/avalon/meta/info/builder
                        BlockBuilder.java Resources.properties
                        SerializedServiceCreator.java
                        SerializedTypeCreator.java ServiceBuilder.java
                        ServiceCreator.java TypeBuilder.java
                        TypeCreator.java TypeFactory.java
                        XMLBlockCreator.java XMLLegacyCreator.java
                        XMLServiceCreator.java XMLTypeCreator.java
                        package.html
               meta/src/java/org/apache/avalon/meta/info/builder/doc-files
                        ServiceBuilder.gif TypeBuilder.gif
               meta/src/java/org/apache/avalon/meta/info/doc-files Type.gif
               meta/src/java/org/apache/avalon/meta/model Category.java
                        ContextDirective.java Entry.java Import.java
                        LoggingDirective.java Mode.java ModelException.java
                        ModelRuntimeException.java Parameter.java
                        Profile.java README.TXT package.html
               meta/src/java/org/apache/avalon/meta/model/builder
                        ProfileBuilder.java ProfileCreator.java
                        Resources.properties package.html
               meta/src/java/org/apache/avalon/meta/model/doc-files uml.gif
               meta/src/java/org/apache/avalon/meta/model/verifier
                        ProfileVerifier.java Resources.properties
                        package.html
               meta/src/java/org/apache/avalon/meta/verifier
                        ComponentVerifier.java Resources.properties
                        VerifyException.java package.html
  Log:
  Restructuring.
  
  Revision  Changes    Path
  1.9       +51 -4     avalon-sandbox/meta/src/java/org/apache/avalon/meta/model/builder/XMLProfileCreator.java
  
  Index: XMLProfileCreator.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/meta/src/java/org/apache/avalon/meta/model/builder/XMLProfileCreator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLProfileCreator.java	27 Feb 2003 22:53:34 -0000	1.8
  +++ XMLProfileCreator.java	10 Mar 2003 15:33:46 -0000	1.9
  @@ -436,13 +436,38 @@
           String name, Configuration config )
           throws Exception
       {
  -        final String priority = config.getAttribute( "priority", null );
  +        return createLoggingDirective( name, null, config );
  +    }
  +
  +    /**
  +     * Utility method to create a new categories directive.
  +     *
  +     * @param name the categories base path
  +     * @param level the default priority
  +     * @param config the categories directive configuration
  +     * @return the categories directive
  +     * @throws Exception if an error occurs
  +     */
  +    public LoggingDirective createLoggingDirective(
  +        String name, String level, Configuration config )
  +        throws Exception
  +    {
  +        String priority;
  +        if( level != null )
  +        {
  +            priority = level;
  +        }
  +        else
  +        {
  +            priority = config.getAttribute( "priority", null );
  +        }
  +
           final String target = config.getAttribute( "target", null );
           ArrayList list = new ArrayList();
           Configuration[] configs = config.getChildren( "category" );
           for( int i = 0; i < configs.length; i++ )
           {
  -            Category category = createCategory( configs[ i ] );
  +            Category category = createCategory( level, configs[ i ] );
               list.add( category );
           }
           Category[] categories =
  @@ -461,8 +486,30 @@
       protected Category createCategory( Configuration config )
           throws ConfigurationException
       {
  +        return createCategory( null, config );
  +    }
  +
  +    /**
  +     * Utility method to create a new category directive.
  +     *
  +     * @param level a overriding priority level
  +     * @param config the category directive configuration
  +     * @return the category directive
  +     * @throws ConfigurationException if an error occurs
  +     */
  +    protected Category createCategory( String level, Configuration config )
  +        throws ConfigurationException
  +    {
           final String name = config.getAttribute( "name", "" );
  -        final String priority = config.getAttribute( "priority", null );
  +        String priority;
  +        if( level != null )
  +        {
  +            priority = level;
  +        }
  +        else
  +        {
  +            priority = config.getAttribute( "priority", null );
  +        }
           final String target = config.getAttribute( "target", null );
           return new Category( name, priority, target );
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message