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

  Modified:    core/src/xdoclet/doc DocumentDocletTask.java
                        DocumentTagsSubTask.java
  Log:
  Re-enabled the beautifier (which I turned off during xjavadoc refactoring)
  
  Revision  Changes    Path
  1.12      +73 -16    xdoclet/core/src/xdoclet/doc/DocumentDocletTask.java
  
  Index: DocumentDocletTask.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/doc/DocumentDocletTask.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- DocumentDocletTask.java   26 Mar 2002 00:01:17 -0000      1.11
  +++ DocumentDocletTask.java   4 Apr 2002 00:27:47 -0000       1.12
  @@ -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;
   
   import xdoclet.DocletTask;
  @@ -9,28 +44,50 @@
   /**
    * @author     Ara Abrahamian ([EMAIL PROTECTED])
    * @created    June 19, 2001
  - * @version    $Revision: 1.11 $
  + * @version $Revision: 1.12 $
  + */
  +public class DocumentDocletTask extends DocletTask {
  +     /**
  +      * @todo-javadoc Describe the field
    */
  -public class DocumentDocletTask extends DocletTask
  -{
        private DocumentTagsSubTask documentTagsSubTask = null;
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private ArrayList infoSubTasks = new ArrayList();
   
  -     public DocumentTagsSubTask createDocumenttags()
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      */
  +     public DocumentTagsSubTask createDocumenttags() {
                documentTagsSubTask = new DocumentTagsSubTask();
                return documentTagsSubTask;
        }
   
  -     public InfoSubTask createInfo()
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @return Describe the return value @todo-javadoc Write javadocs for return
  +      *      value
  +      */
  +     public InfoSubTask createInfo() {
                InfoSubTask infoSubTask = new InfoSubTask( this );
                infoSubTasks.add( infoSubTask );
                return infoSubTask;
        }
   
  -     protected List getSubTasks()
  -     {
  +
  +     /**
  +      * Gets the SubTasks attribute of the DocumentDocletTask object
  +      *
  +      * @return The SubTasks value
  +      */
  +     protected List getSubTasks() {
                List subtasks = super.getSubTasks();
                if( documentTagsSubTask != null ) {
                        subtasks.add( documentTagsSubTask );
  
  
  
  1.15      +261 -91   xdoclet/core/src/xdoclet/doc/DocumentTagsSubTask.java
  
  Index: DocumentTagsSubTask.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/doc/DocumentTagsSubTask.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -r1.14 -r1.15
  --- DocumentTagsSubTask.java  24 Mar 2002 17:44:18 -0000      1.14
  +++ DocumentTagsSubTask.java  4 Apr 2002 00:27:47 -0000       1.15
  @@ -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;
   
   import xdoclet.TemplateSubTask;
  @@ -22,59 +57,125 @@
    *
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   June 19, 2001
  - * @version   $Revision: 1.14 $
  + * @version $Revision: 1.15 $
  + */
  +public class DocumentTagsSubTask extends TemplateSubTask {
  +
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private Namespace currentNamespace;
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private ArrayList namespaces = new ArrayList();
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
  +     private Properties tagMappings = new Properties();
  +     /**
  +      * @todo-javadoc Describe the field
    */
  -public class DocumentTagsSubTask extends TemplateSubTask
  -{
        public final static String SUBTASK_NAME = "documentTags";
   
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String NAMESPACES_TEMPLATE_FILE = "/xdoclet/doc/namespaces.j";
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String GENERATED_NAMESPACES_FILE_NAME = "namespaces.html";
   
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String TAGS_MAIN_TEMPLATE_FILE = "/xdoclet/doc/tags_main.j";
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String GENERATED_TAGS_MAIN_FILE_NAME = "tags.html";
   
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String TAGS_TOC_MAIN_TEMPLATE_FILE = 
"/xdoclet/doc/tags_toc_main.j";
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String GENERATED_TAGS_TOC_MAIN_FILE_NAME = "tags_toc.html";
   
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String TAGS_TOC_TEMPLATE_FILE = "/xdoclet/doc/tags_toc.j";
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String GENERATED_TAGS_TOC_FILE_NAME = "{0}_toc.html";
   
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String TAGS_TEMPLATE_FILE = "/xdoclet/doc/tags.j";
  +     /**
  +      * @todo-javadoc Describe the field
  +      */
        private static String GENERATED_TAGS_FILE_NAME = "{0}.html";
   
  -     private Namespace  currentNamespace;
  -     private ArrayList  namespaces = new ArrayList();
  -     private Properties tagMappings = new Properties();
   
  -     public String getSubTaskName()
  -     {
  +     /**
  +      * Gets the SubTaskName attribute of the DocumentTagsSubTask object
  +      *
  +      * @return The SubTaskName value
  +      */
  +     public String getSubTaskName() {
                return SUBTASK_NAME;
        }
   
  -     public Namespace getCurrentNamespace()
  -     {
  +
  +     /**
  +      * Gets the CurrentNamespace attribute of the DocumentTagsSubTask object
  +      *
  +      * @return The CurrentNamespace value
  +      */
  +     public Namespace getCurrentNamespace() {
                return currentNamespace;
        }
   
  -     public ArrayList getNamespaces()
  -     {
  +
  +     /**
  +      * Gets the Namespaces attribute of the DocumentTagsSubTask object
  +      *
  +      * @return The Namespaces value
  +      */
  +     public ArrayList getNamespaces() {
                return namespaces;
        }
   
  -     public Properties getTagMappings()
  -     {
  +
  +     /**
  +      * Gets the TagMappings attribute of the DocumentTagsSubTask object
  +      *
  +      * @return The TagMappings value
  +      */
  +     public Properties getTagMappings() {
                return tagMappings;
        }
   
  -     public void execute() throws XDocletException
  -     {
  +
  +     /**
  +      * Describe what the method does @todo-javadoc Write javadocs for method
  +      *
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     public void execute() throws XDocletException {
                Properties tag_handler_mappings = loadTagMappings();
   
                Set entry_set = tag_handler_mappings.entrySet();
   
  -             for( Iterator iterator = entry_set.iterator(); iterator.hasNext();  )
  -             {
  +             for (Iterator iterator = entry_set.iterator(); iterator.hasNext(); ) {
                        Map.Entry entry = ( Map.Entry ) iterator.next();
   
                        namespaces.add( new Namespace( ( String ) entry.getKey(), ( 
String ) entry.getValue() ) );
  @@ -112,96 +213,165 @@
                startProcess();
        }
   
  -     protected String getGeneratedFileName( XClass clazz ) throws XDocletException
  -     {
  +
  +     /**
  +      * Gets the GeneratedFileName attribute of the DocumentTagsSubTask object
  +      *
  +      * @param clazz Describe what the parameter does @todo-javadoc Write javadocs
  +      *      for method parameter
  +      * @return The GeneratedFileName value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     protected String getGeneratedFileName(XClass clazz) throws XDocletException {
                String dest_file = MessageFormat.format( getDestinationFile(), new 
Object[]{currentNamespace.getName()} );
   
                return new File( dest_file ).toString();
        }
   
  +
        /**
         * Processed template for clazz and generates output file for clazz.
         *
         * @param clazz                 Description of Parameter
         * @exception XDocletException  Description of Exception
         */
  -     protected void generateForClass( XClass clazz ) throws XDocletException
  -     {
  +     protected void generateForClass(XClass clazz) throws XDocletException {
                setCurrentNamespace( clazz );
   
                super.generateForClass( clazz );
        }
   
  -     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 {
        }
   
  -     private void setCurrentNamespace( XClass clazz ) throws XDocletException
  -     {
  -             for( int i = 0; i < namespaces.size(); i++ )
  -             {
  +
  +     /**
  +      * Sets the CurrentNamespace attribute of the DocumentTagsSubTask object
  +      *
  +      * @param clazz The new CurrentNamespace value
  +      * @exception XDocletException Describe the exception @todo-javadoc Write
  +      *      javadocs for exception
  +      */
  +     private void setCurrentNamespace(XClass clazz) throws XDocletException {
  +             for (int i = 0; i < namespaces.size(); i++) {
                        Namespace namespace = ( Namespace ) namespaces.get( i );
   
  -                     if( namespace.getTagsHandlerClassName().equals( 
clazz.qualifiedName() ) )
  -                     {
  +                     if 
(namespace.getTagsHandlerClassName().equals(clazz.qualifiedName())) {
                                currentNamespace = namespace;
                                break;
                        }
                }
        }
   
  -     private Properties loadTagMappings() 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
  +      */
  +     private Properties loadTagMappings() throws XDocletException {
                //we should reload it here directly, because TemplateEngine may also 
have
                //non-default handlers registered by TagDef.
  -             try
  -             {
  +             try {
                        tagMappings.load( getClass().getResourceAsStream( 
TemplateEngine.TAG_MAPPINGS_FILE ) );
  -             }
  -             catch( IOException e )
  -             {
  +             } catch (IOException e) {
                        throw new XDocletException( Translator.getString( 
"template_couldnt_load_mappings" ) );
                }
   
                return tagMappings;
        }
   
  +
        /**
  +      * @author Aslak Helles�y
         * @created   December 1, 2001
         */
  -     public static class Namespace implements Comparable
  -     {
  +     public static class Namespace implements Comparable {
  +             /**
  +              * @todo-javadoc Describe the field
  +              */
                private String    name;
  +             /**
  +              * @todo-javadoc Describe the field
  +              */
                private String    tagsHandlerClassName;
   
  -             public Namespace( String name, String tagsHandlerClassName )
  -             {
  +
  +             /**
  +              * Describe what the Namespace constructor does @todo-javadoc Write 
javadocs
  +              * for constructor
  +              *
  +              * @param name Describe what the parameter does @todo-javadoc Write 
javadocs
  +              *      for method parameter
  +              * @param tagsHandlerClassName Describe what the parameter does 
@todo-javadoc
  +              *      Write javadocs for method parameter
  +              */
  +             public Namespace(String name, String tagsHandlerClassName) {
                        this.name = name;
                        this.tagsHandlerClassName = tagsHandlerClassName;
                }
   
  -             public String getName()
  -             {
  -                     return name;
  +
  +             /**
  +              * Sets the Name attribute of the Namespace object
  +              *
  +              * @param name The new Name value
  +              */
  +             public void setName(String name) {
  +                     this.name = name;
                }
   
  -             public String getTagsHandlerClassName()
  -             {
  -                     return tagsHandlerClassName;
  +
  +             /**
  +              * Sets the TagsHandlerClassName attribute of the Namespace object
  +              *
  +              * @param tagsHandlerClassName The new TagsHandlerClassName value
  +              */
  +             public void setTagsHandlerClassName(String tagsHandlerClassName) {
  +                     this.tagsHandlerClassName = tagsHandlerClassName;
                }
   
  -             public void setName( String name )
  -             {
  -                     this.name = name;
  +
  +             /**
  +              * Gets the Name attribute of the Namespace object
  +              *
  +              * @return The Name value
  +              */
  +             public String getName() {
  +                     return name;
                }
   
  -             public void setTagsHandlerClassName( String tagsHandlerClassName )
  -             {
  -                     this.tagsHandlerClassName = tagsHandlerClassName;
  +
  +             /**
  +              * Gets the TagsHandlerClassName attribute of the Namespace object
  +              *
  +              * @return The TagsHandlerClassName value
  +              */
  +             public String getTagsHandlerClassName() {
  +                     return tagsHandlerClassName;
                }
   
  -             public int compareTo( Object o )
  -             {
  +
  +             /**
  +              * Describe what the method does @todo-javadoc Write javadocs for 
method
  +              *
  +              * @param o Describe what the parameter does @todo-javadoc Write 
javadocs for
  +              *      method parameter
  +              * @return Describe the return value @todo-javadoc Write javadocs for 
return
  +              *      value
  +              */
  +             public int compareTo(Object o) {
                        return this.getName().compareTo( ( ( Namespace ) o ).getName() 
);
                }
        }
  
  
  

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

Reply via email to