avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/containerkit/lib/xdoclet commons-logging.jar xdoclet-20020825.jar xjavadoc-20020825.jar xdoclet-20021804.jar xjavadoc-20021804.jar
Date Sun, 25 Aug 2002 07:11:25 GMT
donaldp     2002/08/25 00:11:25

  Modified:    containerkit build.xml
               containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet
                        AvalonTagHandler.java AvalonXDoclet.java
                        ComponentInfoSubTask.java
  Added:       containerkit/lib/xdoclet commons-logging.jar
                        xdoclet-20020825.jar xjavadoc-20020825.jar
  Removed:     containerkit/lib/xdoclet xdoclet-20021804.jar
                        xjavadoc-20021804.jar
  Log:
  Update to latest xdoclet.
  
  Revision  Changes    Path
  1.14      +1 -4      jakarta-avalon-excalibur/containerkit/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/build.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- build.xml	23 Aug 2002 09:32:48 -0000	1.13
  +++ build.xml	25 Aug 2002 07:11:24 -0000	1.14
  @@ -279,10 +279,7 @@
           </taskdef>
   
           <mkdir dir="gen"/>
  -        <avalon-xinfo
  -            force="true"
  -            destdir="gen"
  -            classpathref="project.class.path">
  +        <avalon-xinfo force="true" destdir="gen" >
               <fileset dir="${java.dir}">
                   <include name="**/demo/components/*.java" />
               </fileset>
  
  
  
  1.2       +32 -27    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/AvalonTagHandler.java
  
  Index: AvalonTagHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/AvalonTagHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AvalonTagHandler.java	18 Aug 2002 06:39:00 -0000	1.1
  +++ AvalonTagHandler.java	25 Aug 2002 07:11:24 -0000	1.2
  @@ -8,8 +8,10 @@
   package org.apache.excalibur.containerkit.tools.xdoclet;
   
   import java.util.Properties;
  +import java.util.Collection;
  +import java.util.Iterator;
   import xdoclet.XDocletException;
  -import xdoclet.tags.AbstractProgramElementTagsHandler;
  +import xdoclet.XDocletTagSupport;
   import xjavadoc.XClass;
   import xjavadoc.XMethod;
   import xjavadoc.XPackage;
  @@ -22,7 +24,7 @@
    * @version $Revision$ $Date$
    */
   public class AvalonTagHandler
  -    extends AbstractProgramElementTagsHandler
  +    extends XDocletTagSupport
   {
       private static String c_attribute;
   
  @@ -31,7 +33,7 @@
       {
           final String property = atributes.getProperty( "name", "" );
           final XClass currentClass = getCurrentClass();
  -        final XTag xTag = currentClass.doc().tag( property );
  +        final XTag xTag = currentClass.getDoc().getTag( property );
           setCurrentClassTag( xTag );
       }
   
  @@ -44,7 +46,7 @@
           {
               return;
           }
  -        final XTag xTag = method.doc().tag( attribute );
  +        final XTag xTag = method.getDoc().getTag( attribute );
           setCurrentMethodTag( xTag );
       }
   
  @@ -75,10 +77,10 @@
           throws XDocletException
       {
           final XTag tag = getCurrentTag( attributes );
  -        final String[] attributeNames = tag.attributeValueNames();
  -        for( int i = 0; i < attributeNames.length; i++ )
  +        final Iterator attributeNames = tag.getAttributeNames().iterator();
  +        while( attributeNames.hasNext() )
           {
  -            c_attribute = attributeNames[ i ];
  +            c_attribute = (String)attributeNames.next();
               generate( template );
           }
           c_attribute = null;
  @@ -101,33 +103,35 @@
           {
               XClass xClass = null;
   
  -            xClass = findClass( typeName, getCurrentClass().importedClasses() );
  +            xClass = findClass( typeName, getCurrentClass().getImportedClasses() );
               if( null != xClass )
               {
  -                return xClass.qualifiedName();
  +                return xClass.getQualifiedName();
               }
   
  -            final XClass[] classes = getCurrentClass().containingPackage().classes();
  +            final Collection classes = getCurrentClass().getContainingPackage().getClasses();
               xClass = findClass( typeName, classes );
               if( null != xClass )
               {
  -                return xClass.qualifiedName();
  +                return xClass.getQualifiedName();
               }
   
  -            final XPackage[] xPackages = getCurrentClass().importedPackages();
  -            for( int i = 0; i < xPackages.length; i++ )
  +            final Iterator xPackages =
  +                getCurrentClass().getImportedPackages().iterator();
  +            while( xPackages.hasNext() )
               {
  -                xClass = findClass( typeName, xPackages[ i ].classes() );
  +                final XPackage xPackage = (XPackage)xPackages.next();
  +                xClass = findClass( typeName, xPackage.getClasses() );
                   if( null != xClass )
                   {
  -                    return xClass.qualifiedName();
  +                    return xClass.getQualifiedName();
                   }
               }
   
  -            xClass = findClass( typeName, getDefaultPackage().classes() );
  +            xClass = findClass( typeName, getDefaultPackage().getClasses() );
               if( null != xClass )
               {
  -                return xClass.qualifiedName();
  +                return xClass.getQualifiedName();
               }
   
               return typeName;
  @@ -136,25 +140,26 @@
   
       private XPackage getDefaultPackage()
       {
  -        XClass xClass = getCurrentClass().superclass();
  +        XClass xClass = getCurrentClass().getSuperclass();
           XClass newXClass = xClass;
           while( null != newXClass &&
  -            !newXClass.qualifiedName().equals( "java.lang.Object" ) )
  +            !newXClass.getQualifiedName().equals( "java.lang.Object" ) )
           {
               xClass = newXClass;
  -            newXClass = getCurrentClass().superclass();
  +            newXClass = getCurrentClass().getSuperclass();
           }
  -        return xClass.containingPackage();
  +        return xClass.getContainingPackage();
       }
   
       private XClass findClass( final String name,
  -                              final XClass[] classes )
  +                              final Collection classes )
       {
           XClass xClass = null;
  -        for( int i = 0; i < classes.length; i++ )
  +        final Iterator iterator = classes.iterator();
  +        while( iterator.hasNext() )
           {
  -            final XClass singleImport = classes[ i ];
  -            final String classname = singleImport.name();
  +            final XClass singleImport = (XClass)iterator.next();
  +            final String classname = singleImport.getName();
               if( classname.equals( name ) )
               {
                   xClass = singleImport;
  @@ -173,7 +178,7 @@
           }
           else
           {
  -            return tag.attributeValue( c_attribute );
  +            return tag.getAttributeValue( c_attribute );
           }
       }
   
  
  
  
  1.2       +2 -9      jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/AvalonXDoclet.java
  
  Index: AvalonXDoclet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/AvalonXDoclet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AvalonXDoclet.java	18 Aug 2002 06:39:00 -0000	1.1
  +++ AvalonXDoclet.java	25 Aug 2002 07:11:24 -0000	1.2
  @@ -8,7 +8,6 @@
   package org.apache.excalibur.containerkit.tools.xdoclet;
   
   import xdoclet.DocletTask;
  -import java.util.List;
   
   /**
    * A simple XDoclet task that generates the .xinfo files for
  @@ -25,14 +24,8 @@
       public ComponentInfoSubTask createComponentInfo()
       {
           m_componentInfoSubTask = new ComponentInfoSubTask();
  +        addTemplate( m_componentInfoSubTask );
           return m_componentInfoSubTask;
  -    }
  -
  -    protected List getSubTasks()
  -    {
  -        final List subtasks = super.getSubTasks();
  -        subtasks.add( m_componentInfoSubTask );
  -        return subtasks;
       }
   }
   
  
  
  
  1.2       +12 -88    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/ComponentInfoSubTask.java
  
  Index: ComponentInfoSubTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/tools/xdoclet/ComponentInfoSubTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentInfoSubTask.java	18 Aug 2002 06:39:00 -0000	1.1
  +++ ComponentInfoSubTask.java	25 Aug 2002 07:11:24 -0000	1.2
  @@ -7,14 +7,12 @@
    */
   package org.apache.excalibur.containerkit.tools.xdoclet;
   
  +import java.net.URL;
   import xdoclet.TemplateSubTask;
   import xdoclet.XDocletException;
   import xdoclet.template.TemplateException;
  -import java.net.URL;
  -import java.io.File;
  -import xjavadoc.XClass;
   
  -/**
  +/**                                   
    * Generates ComponentInfo 'xinfo' files for Components.
    *
    * @author <a href="mailto:vinay_chandran@users.sourceforge.net">Vinay Chandrasekharan</a>
  @@ -24,26 +22,22 @@
   public class ComponentInfoSubTask
       extends TemplateSubTask
   {
  -    public static final String SUBTASK_NAME = "componentinfo";
  -
  -    private static final String GENERATED_FILE_NAME = "{0}-info.xml";
       private static final String DEFAULT_TEMPLATE_FILE =
  -        "/org/apache/excalibur/containerkit/xdoclet/componentinfo.xdt";
  -
  -    private static String c_classPattern;
  -
  -    private String m_templatePath;
  +        "/org/apache/excalibur/containerkit/tools/xdoclet/componentinfo.xdt";
   
       public ComponentInfoSubTask()
       {
  +        setupParams();
  +    }
  +
  +    private void setupParams()
  +    {
           final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
           setTemplateURL( resource );
  -        setDestinationFile( GENERATED_FILE_NAME );
  +        setDestinationFile( "{0}-info.xml" );
           setHavingClassTag( "avalon.component" );
  -
  -        final TemplateSubTask.ExtentTypes extent = new TemplateSubTask.ExtentTypes();
  -        extent.setValue( "hierarchy" );
  -        setExtent( extent );
  +        setAcceptAbstractClasses( false );
  +        setSubTaskName( "componentinfo" );
       }
   
       /**
  @@ -60,76 +54,6 @@
           catch( final TemplateException e )
           {
               throw new XDocletException( e, e.getMessage() );
  -        }
  -    }
  -
  -    public void setTemplatePath( final String templatePath )
  -    {
  -        m_templatePath = templatePath;
  -        setTemplateFile( new File( templatePath ) );
  -    }
  -
  -    public static String getClassPattern()
  -    {
  -        return c_classPattern;
  -    }
  -
  -    public String getSubTaskName()
  -    {
  -        return SUBTASK_NAME;
  -    }
  -
  -    public void setPattern( final String classPattern )
  -    {
  -        c_classPattern = classPattern;
  -    }
  -
  -    /**
  -     * Called to validate configuration parameters.
  -     */
  -    public void validateOptions()
  -        throws XDocletException
  -    {
  -        super.validateOptions();
  -
  -        if( null == m_templatePath )
  -        {
  -            throw new XDocletException( "'templatePath' attribute is missing ." );
  -        }
  -
  -        final URL template = getTemplateURL();
  -        if( null == template )
  -        {
  -            throw new XDocletException( "'template' is missing." );
  -        }
  -
  -        if( null == getClassPattern() || getClassPattern().trim().equals( "" ) )
  -        {
  -            throw new XDocletException( "'pattern' parameter missing or empty." );
  -        }
  -
  -        if( -1 == getClassPattern().indexOf( "{0}" ) )
  -        {
  -            throw new XDocletException( "'pattern' parameter does not have a " +
  -                                        "'{0}' in it. '{0}' is replaced by Component "
+
  -                                        "name of the class under processing." );
  -        }
  -    }
  -
  -    protected boolean matchesGenerationRules( final XClass clazz )
  -        throws XDocletException
  -    {
  -        if( !super.matchesGenerationRules( clazz ) )
  -        {
  -            return false;
  -        }
  -        else if( clazz.isAbstract() )
  -        {
  -            return false;
  -        }
  -        else
  -        {
  -            return true;
           }
       }
   }
  
  
  
  1.1                  jakarta-avalon-excalibur/containerkit/lib/xdoclet/commons-logging.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/containerkit/lib/xdoclet/xdoclet-20020825.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/containerkit/lib/xdoclet/xjavadoc-20020825.jar
  
  	<<Binary file>>
  
  

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


Mime
View raw message