User: rinkrank
  Date: 02/04/03 16:27:47

  Modified:    core/src/xdoclet/doc/info InfoSubTask.java
                        InfoTagsHandler.java
  Log:
  Re-enabled the beautifier (which I turned off during xjavadoc refactoring)
  
  Revision  Changes    Path
  1.19      +162 -80   xdoclet/core/src/xdoclet/doc/info/InfoSubTask.java
  
  Index: InfoSubTask.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/doc/info/InfoSubTask.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -r1.18 -r1.19
  --- InfoSubTask.java  26 Mar 2002 00:01:18 -0000      1.18
  +++ InfoSubTask.java  4 Apr 2002 00:27:47 -0000       1.19
  @@ -1,3 +1,38 @@
  +/*
  + * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
  + * All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modification,
  + * are permitted provided that the following conditions are met:
  + *
  + * - Redistributions of source code must retain the above copyright notice,
  + *   this list of conditions and the following disclaimer.
  + *
  + * - Redistributions in binary form must reproduce the above copyright
  + *   notice, this list of conditions and the following disclaimer in the
  + *   documentation and/or other materials provided with the distribution.
  + *
  + * - Neither the name of BEKK Consulting nor the names of its
  + *   contributors may be used to endorse or promote products derived from
  + *   this software without specific prior written permission.
  + *
  + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
  + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  + * DAMAGE.
  + */
  +
  +/*
  + * Change log
  + *
  + */
   package xdoclet.doc.info;
   
   import xjavadoc.XClass;
  @@ -30,29 +65,36 @@
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created   September 18, 2001
  - * @version   $Revision: 1.18 $
  + * @version $Revision: 1.19 $
    * @todo This is a test on class level
    * @todo This is another test on class level
    */
  -public class InfoSubTask extends TemplateSubTask
  -{
  -     /**
  -      * @todo blabla (this is a test)
  -      */
  -     public final static String SUBTASK_NAME = "info";
  +public class InfoSubTask extends TemplateSubTask {
   
        /**
         * @todo blabla (this is another test)
         */
        private final Properties _properties = new Properties();
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private String     _header;
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private String     _projectname;
  +     /**
  +      * @todo blabla (this is a test)
  +      */
  +     public final static String SUBTASK_NAME = "info";
  +
   
        /**
         * @todo blabla (this is yet another test)
  +      * @param documentDocletTask Describe what the parameter does @todo-javadoc
  +      *      Write javadocs for method parameter
         */
  -     public InfoSubTask( DocumentDocletTask documentDocletTask )
  -     {
  +     public InfoSubTask(DocumentDocletTask documentDocletTask) {
                // Set default values
                setHeader( "Todo list" );
                setTag( "todo" );
  @@ -64,43 +106,73 @@
                _properties.setProperty( "superclasses", "false" );
        }
   
  -     public String getHeader()
  -     {
  -             return _header;
  +
  +     /**
  +      * Sets the Header attribute of the InfoSubTask object
  +      *
  +      * @param header The new Header value
  +      */
  +     public void setHeader(String header) {
  +             _header = header;
        }
   
  -     public String getSubTaskName()
  -     {
  -             return SUBTASK_NAME;
  +
  +     /**
  +      * Sets the Tag attribute of the InfoSubTask object
  +      *
  +      * @param tag The new Tag value
  +      */
  +     public void setTag(String tag) {
  +             _properties.setProperty("tagName", tag);
        }
   
  -     public String getProjectname()
  -     {
  -             return _projectname;
  +
  +     /**
  +      * Sets the Projectname attribute of the InfoSubTask object
  +      *
  +      * @param projectname The new Projectname value
  +      */
  +     public void setProjectname(String projectname) {
  +             _projectname = projectname;
        }
   
  -     public void setHeader( String header )
  -     {
  -             _header = header;
  +
  +     /**
  +      * Gets the Header attribute of the InfoSubTask object
  +      *
  +      * @return The Header value
  +      */
  +     public String getHeader() {
  +             return _header;
        }
   
  -     public void setTag( String tag )
  -     {
  -             _properties.setProperty( "tagName", tag );
  +
  +     /**
  +      * Gets the SubTaskName attribute of the InfoSubTask object
  +      *
  +      * @return The SubTaskName value
  +      */
  +     public String getSubTaskName() {
  +             return SUBTASK_NAME;
        }
   
  -     public void setProjectname( String projectname )
  -     {
  -             _projectname = projectname;
  +
  +     /**
  +      * Gets the Projectname attribute of the InfoSubTask object
  +      *
  +      * @return The Projectname value
  +      */
  +     public String getProjectname() {
  +             return _projectname;
        }
   
  +
        /**
  +      * @todo generate an overview summary html too? (the default right page). It
  +      *      could be the old todo file, a bit modified.
         * @exception XDocletException  Description of Exception
  -      * @todo                        generate an overview summary html too? (the
  -      *      default right page). It could be the old todo file, a bit modified.
         */
  -     public void execute() throws XDocletException
  -     {
  +     public void execute() throws XDocletException {
                Category cat = Log.getCategory( InfoSubTask.class, "execute" );
   
                System.out.println( Translator.getString( "xdoclet.doc.Messages", 
"create_info_lists_for",
  @@ -144,13 +216,13 @@
                XClass[] classes = AbstractProgramElementTagsHandler.getAllClasses();
                SortedSet packages = new TreeSet();
   
  -             for( int i = 0; i < classes.length; i++ )
  +             for (int i = 0; i < classes.length; i++) {
                        packages.add( classes[i].containingPackage() );
  +             }
   
                XPackage cur_package = null;
   
  -             for( Iterator packageIterator = packages.iterator(); 
packageIterator.hasNext();  )
  -             {
  +             for (Iterator packageIterator = packages.iterator(); 
packageIterator.hasNext(); ) {
                        cur_package = ( XPackage ) packageIterator.next();
                        setCurrentPackage( cur_package );
   
  @@ -164,8 +236,7 @@
   
                        classes = AbstractProgramElementTagsHandler.getAllClasses();
                        setTemplateURL( getClass().getResource( 
"/xdoclet/doc/info/class-details.j" ) );
  -                     for( int i = 0; i < classes.length; i++ )
  -                     {
  +                     for (int i = 0; i < classes.length; i++) {
                                setCurrentClass( classes[i] );
                                setDestinationFile( ClassTagsHandler.getClassNameFor( 
getCurrentClass() ) + "-details.html" );
                                startProcess();
  @@ -180,12 +251,23 @@
                setCurrentPackage( null );
        }
   
  -     protected Properties getProperties()
  -     {
  +
  +     /**
  +      * Gets the Properties attribute of the InfoSubTask object
  +      *
  +      * @return The Properties value
  +      */
  +     protected Properties getProperties() {
                return _properties;
        }
   
  -     protected void engineStarted() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     protected void engineStarted() throws XDocletException {
        }
   }
  
  
  
  1.11      +414 -197  xdoclet/core/src/xdoclet/doc/info/InfoTagsHandler.java
  
  Index: InfoTagsHandler.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/doc/info/InfoTagsHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- InfoTagsHandler.java      26 Mar 2002 00:01:18 -0000      1.10
  +++ InfoTagsHandler.java      4 Apr 2002 00:27:47 -0000       1.11
  @@ -1,3 +1,38 @@
  +/*
  + * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
  + * All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modification,
  + * are permitted provided that the following conditions are met:
  + *
  + * - Redistributions of source code must retain the above copyright notice,
  + *   this list of conditions and the following disclaimer.
  + *
  + * - Redistributions in binary form must reproduce the above copyright
  + *   notice, this list of conditions and the following disclaimer in the
  + *   documentation and/or other materials provided with the distribution.
  + *
  + * - Neither the name of BEKK Consulting nor the names of its
  + *   contributors may be used to endorse or promote products derived from
  + *   this software without specific prior written permission.
  + *
  + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
  + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  + * DAMAGE.
  + */
  +
  +/*
  + * Change log
  + *
  + */
   package xdoclet.doc.info;
   
   import xjavadoc.XPackage;
  @@ -25,118 +60,176 @@
   /**
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.10 $
  + * @version $Revision: 1.11 $
  + */
  +public class InfoTagsHandler extends XDocletTagSupport {
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param template Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param properties Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
    */
  -public class InfoTagsHandler extends XDocletTagSupport
  -{
  -     public void ifTagCountNotZero( String template, Properties properties ) throws 
XDocletException
  -     {
  +     public void ifTagCountNotZero(String template, Properties properties) throws 
XDocletException {
                String level = properties.getProperty( "level" );
                int tagCount = tagCount_Impl( level );
  -             if( tagCount != 0 )
  -             {
  +             if (tagCount != 0) {
                        generate( template );
                }
        }
   
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param properties Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
        public String tagCount(Properties properties ) throws XDocletException {
                String level = properties.getProperty( "level" );
                int tagCount = tagCount_Impl( level );
                return String.valueOf(tagCount);
        }
   
  -     private int tagCount_Impl( String level ) throws XDocletException {
  -             int tagCount = 0;
   
  -             if( "all".equals( level ) )
  -             {
  -                     tagCount = tagCountInAll_Impl( getProperties() );
  -             }
  -             else if( "package".equals( level ) )
  -             {
  -                     tagCount = tagCountInPackage_Impl( getProperties(), 
getCurrentPackage() );
  -             }
  -             else if( "whole-class".equals( level ) )
  -             {
  -                     tagCount = tagCountInClass_Impl( getProperties(), 
getCurrentClass(), true, true, true, true );
  -             }
  -             else if( "class".equals( level ) )
  -             {
  -                     tagCount = tagCountInClass_Impl( getProperties(), 
getCurrentClass(), true, false, false, false );
  -             }
  -             else if( "field".equals( level ) )
  -             {
  -                     tagCount = tagCountInClass_Impl( getProperties(), 
getCurrentClass(), false, true, false, false );
  -             }
  -             else if( "constructor".equals( level ) )
  -             {
  -                     tagCount = tagCountInClass_Impl( getProperties(), 
getCurrentClass(), false, false, true, false );
  -             }
  -             else if( "method".equals( level ) )
  -             {
  -                     tagCount = tagCountInClass_Impl( getProperties(), 
getCurrentClass(), false, false, false, true );
  -             }
  -             else
  -             {
  -                     throw new XDocletException( Translator.getString( 
"xdoclet.doc.Messages",
  -                             "bad_level", new String[]{level} ) );
  -             }
  -             return tagCount;
  -     }
  -
  -     public String classTagValue() throws XDocletException
  -     {
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String classTagValue() throws XDocletException {
                return getClassTagsHandler().classTagValue( getProperties() );
        }
   
  -     public String fieldTagValue() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String fieldTagValue() throws XDocletException {
                return getFieldTagsHandler().fieldTagValue( getProperties() );
        }
   
  -     public String constructorTagValue() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String constructorTagValue() throws XDocletException {
                return getConstructorTagsHandler().constructorTagValue( 
getProperties() );
        }
   
  -     public String methodTagValue() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String methodTagValue() throws XDocletException {
                return getMethodTagsHandler().methodTagValue( getProperties() );
        }
   
  -     public void forAllClassTags( String template ) throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param template Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public void forAllClassTags(String template) throws XDocletException {
                getClassTagsHandler().forAllClassTags( template, getProperties() );
        }
   
  -     public void forAllConstructorTags( String template ) throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param template Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public void forAllConstructorTags(String template) throws XDocletException {
                getConstructorTagsHandler().forAllConstructorTags( template, 
getProperties() );
        }
   
  -     public void forAllMethodTags( String template ) throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param template Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public void forAllMethodTags(String template) throws XDocletException {
                getMethodTagsHandler().forAllMethodTags( template, getProperties() );
        }
   
  -     public void forAllFieldTags( String template ) throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param template Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public void forAllFieldTags(String template) throws XDocletException {
                getFieldTagsHandler().forAllFieldTags( template, getProperties() );
        }
   
  -     public String projectname() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String projectname() throws XDocletException {
                InfoSubTask infoSubTask = ( InfoSubTask ) 
getDocletContext().getActiveSubTask();
   
                return infoSubTask.getProjectname();
        }
   
  -     public String rootlink() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public String rootlink() throws XDocletException {
                String packageName = "";
   
  -             if( getPackageTagsHandler().packageName() != null )
  -             {
  +             if (getPackageTagsHandler().packageName() != null) {
                        packageName = getPackageTagsHandler().packageName();
                }
   
  @@ -144,102 +237,176 @@
                int n = st.countTokens();
                StringBuffer sb = new StringBuffer();
   
  -             for( int i = 0; i < n; i++ )
  -             {
  +             for (int i = 0; i < n; i++) {
                        sb.append( "../" );
                }
                return sb.toString();
        }
   
  -     private Properties getProperties()
  -     {
  +
  +     /**
  +      * Gets the Properties attribute of the InfoTagsHandler object
  +      *
  +      * @return The Properties value
  +      */
  +     private Properties getProperties() {
                Properties properties = ( ( InfoSubTask ) 
getDocletContext().getActiveSubTask() ).getProperties();
   
                return properties;
        }
   
  -     private MethodTagsHandler getMethodTagsHandler() throws XDocletException
  -     {
  -             try
  -             {
  +
  +     /**
  +      * Gets the MethodTagsHandler attribute of the InfoTagsHandler object
  +      *
  +      * @return The MethodTagsHandler value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private MethodTagsHandler getMethodTagsHandler() throws XDocletException {
  +             try {
                        return ( ( MethodTagsHandler ) getEngine().getTagHandlerFor( 
"Method" ) );
  -             }
  -             catch( TemplateException ex )
  -             {
  +             } catch (TemplateException ex) {
                        throw new XDocletException( ex, Translator.getString( 
"xdoclet.doc.Messages",
                                "tagshandler_not_found", new 
String[]{"MethodTagsHandler", "Method"} ) );
                }
        }
   
  -     private FieldTagsHandler getFieldTagsHandler() throws XDocletException
  -     {
  -             try
  -             {
  +
  +     /**
  +      * Gets the FieldTagsHandler attribute of the InfoTagsHandler object
  +      *
  +      * @return The FieldTagsHandler value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private FieldTagsHandler getFieldTagsHandler() throws XDocletException {
  +             try {
                        return ( ( FieldTagsHandler ) getEngine().getTagHandlerFor( 
"Field" ) );
  -             }
  -             catch( TemplateException ex )
  -             {
  +             } catch (TemplateException ex) {
                        throw new XDocletException( ex, Translator.getString( 
"xdoclet.doc.Messages",
                                "tagshandler_not_found", new 
String[]{"FieldTagsHandler", "Field"} ) );
                }
        }
   
  -     private ConstructorTagsHandler getConstructorTagsHandler() throws 
XDocletException
  -     {
  -             try
  -             {
  +
  +     /**
  +      * Gets the ConstructorTagsHandler attribute of the InfoTagsHandler object
  +      *
  +      * @return The ConstructorTagsHandler value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private ConstructorTagsHandler getConstructorTagsHandler() throws 
XDocletException {
  +             try {
                        return ( ( ConstructorTagsHandler ) 
getEngine().getTagHandlerFor( "Constructor" ) );
  -             }
  -             catch( TemplateException ex )
  -             {
  +             } catch (TemplateException ex) {
                        throw new XDocletException( ex, Translator.getString( 
"xdoclet.doc.Messages",
                                "tagshandler_not_found", new 
String[]{"ConstructorTagsHandler", "Constructor"} ) );
                }
        }
   
  -     private ClassTagsHandler getClassTagsHandler() throws XDocletException
  -     {
  -             try
  -             {
  +
  +     /**
  +      * Gets the ClassTagsHandler attribute of the InfoTagsHandler object
  +      *
  +      * @return The ClassTagsHandler value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private ClassTagsHandler getClassTagsHandler() throws XDocletException {
  +             try {
                        return ( ( ClassTagsHandler ) getEngine().getTagHandlerFor( 
"Class" ) );
  -             }
  -             catch( TemplateException ex )
  -             {
  +             } catch (TemplateException ex) {
                        throw new XDocletException( ex, Translator.getString( 
"xdoclet.doc.Messages",
                                "tagshandler_not_found", new 
String[]{"ClassTagsHandler", "Class"} ) );
                }
        }
   
  -     private PackageTagsHandler getPackageTagsHandler() throws XDocletException
  -     {
  -             try
  -             {
  +
  +     /**
  +      * Gets the PackageTagsHandler attribute of the InfoTagsHandler object
  +      *
  +      * @return The PackageTagsHandler value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private PackageTagsHandler getPackageTagsHandler() throws XDocletException {
  +             try {
                        return ( ( PackageTagsHandler ) getEngine().getTagHandlerFor( 
"Package" ) );
  -             }
  -             catch( TemplateException ex )
  -             {
  +             } catch (TemplateException ex) {
                        throw new XDocletException( ex, Translator.getString( 
"xdoclet.doc.Messages",
                                "tagshandler_not_found", new 
String[]{"PackageTagsHandler", "Package"} ) );
                }
        }
   
  -     private int tagCountInAll_Impl( Properties attributes ) throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param level Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private int tagCount_Impl(String level) throws XDocletException {
  +             int tagCount = 0;
  +
  +             if ("all".equals(level)) {
  +                     tagCount = tagCountInAll_Impl(getProperties());
  +             }
  +             else if ("package".equals(level)) {
  +                     tagCount = tagCountInPackage_Impl(getProperties(), 
getCurrentPackage());
  +             }
  +             else if ("whole-class".equals(level)) {
  +                     tagCount = tagCountInClass_Impl(getProperties(), 
getCurrentClass(), true, true, true, true);
  +             }
  +             else if ("class".equals(level)) {
  +                     tagCount = tagCountInClass_Impl(getProperties(), 
getCurrentClass(), true, false, false, false);
  +             }
  +             else if ("field".equals(level)) {
  +                     tagCount = tagCountInClass_Impl(getProperties(), 
getCurrentClass(), false, true, false, false);
  +             }
  +             else if ("constructor".equals(level)) {
  +                     tagCount = tagCountInClass_Impl(getProperties(), 
getCurrentClass(), false, false, true, false);
  +             }
  +             else if ("method".equals(level)) {
  +                     tagCount = tagCountInClass_Impl(getProperties(), 
getCurrentClass(), false, false, false, true);
  +             }
  +             else {
  +                     throw new 
XDocletException(Translator.getString("xdoclet.doc.Messages",
  +                                     "bad_level", new String[]{level}));
  +             }
  +             return tagCount;
  +     }
  +
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param attributes Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private int tagCountInAll_Impl(Properties attributes) throws XDocletException {
                int tagCount = 0;
                String tag_name = attributes.getProperty( "tagName" );
   
                XClass[] classes = AbstractProgramElementTagsHandler.getAllClasses();
                SortedSet packages = new TreeSet();
   
  -             for( int i = 0; i < classes.length; i++ )
  -             {
  +             for (int i = 0; i < classes.length; i++) {
                        packages.add( classes[i].containingPackage() );
                }
   
                XPackage cur_package = null;
   
  -             for( Iterator packageIterator = packages.iterator(); 
packageIterator.hasNext();  )
  -             {
  +             for (Iterator packageIterator = packages.iterator(); 
packageIterator.hasNext(); ) {
                        cur_package = ( XPackage ) packageIterator.next();
                        tagCount += tagCountInPackage_Impl( attributes, cur_package );
                }
  @@ -247,49 +414,99 @@
                return tagCount;
        }
   
  -     private int tagCountInPackage_Impl( Properties attributes, XPackage pakkage ) 
throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param attributes Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param pakkage Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private int tagCountInPackage_Impl(Properties attributes, XPackage pakkage) 
throws XDocletException {
                int tagCount = 0;
                String tag_name = attributes.getProperty( "tagName" );
                XClass[] classes = pakkage.classes();
  -             for( int i = 0; i < classes.length; i++ )
  -             {
  +             for (int i = 0; i < classes.length; i++) {
                        tagCount += tagCountInClass_Impl( attributes, classes[i], 
true, true, true, true );
                }
                return tagCount;
        }
   
  -     private int tagCountInClass_Impl( Properties attributes, XClass clazz, boolean 
countClass, boolean countFields, boolean countConstructors, boolean countMethods ) 
throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param attributes Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param clazz Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @param countClass Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param countFields Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param countConstructors Describe what the parameter does @todo-javadoc
  +      *      Write javadocs for method parameter
  +      * @param countMethods Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private int tagCountInClass_Impl(Properties attributes, XClass clazz, boolean 
countClass, boolean countFields, boolean countConstructors, boolean countMethods) 
throws XDocletException {
                int tagCount = 0;
                String tagName = attributes.getProperty( "tagName" );
   
  -             if( countClass )
  -             {
  +             if (countClass) {
                        tagCount += tagCount( clazz, tagName );
                }
  -             if( countConstructors )
  -             {
  +             if (countConstructors) {
                        XConstructor[] constructors = clazz.constructors();
                        tagCount += tagCount( constructors, tagName );
                }
  -             if( countMethods )
  -             {
  +             if (countMethods) {
                        XMethod[] methods = clazz.methods();
                        tagCount += tagCount( methods, tagName );
                }
  -             if( countFields )
  -             {
  +             if (countFields) {
                        XField[] fields = clazz.fields();
                        tagCount += tagCount( fields, tagName );
                }
                return tagCount;
        }
   
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param programElement Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param tagName Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      */
        private int tagCount( XProgramElement programElement, String tagName ) {
                int count = programElement.doc().tags( tagName, false ).length;
                return count;
        }
  +
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @param programElements Describe what the parameter does @todo-javadoc Write
  +      *      javadocs for method parameter
  +      * @param tagName Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      */
        private int tagCount( XProgramElement[] programElements, String tagName ) {
                int count = 0;
                for( int i = 0; i < programElements.length; i++ ) {
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to