User: vharcq  
  Date: 02/04/07 06:54:11

  Modified:    core/src/xdoclet/template TemplateEngine.java
  Log:
  Call print() method everywhere.  Flush on every print improves performance
  
  Revision  Changes    Path
  1.25      +20 -25    xdoclet/core/src/xdoclet/template/TemplateEngine.java
  
  Index: TemplateEngine.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/template/TemplateEngine.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -r1.24 -r1.25
  --- TemplateEngine.java       4 Apr 2002 22:56:03 -0000       1.24
  +++ TemplateEngine.java       7 Apr 2002 13:54:11 -0000       1.25
  @@ -35,7 +35,7 @@
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @author    Dmitri Colebatch ([EMAIL PROTECTED])
    * @created   July 14, 2001
  - * @version   $Revision: 1.24 $
  + * @version   $Revision: 1.25 $
    * @see       #generate(java.lang.String)
    */
   public class TemplateEngine
  @@ -349,6 +349,22 @@
        }
   
        /**
  +      * Describe what the method does
  +      *
  +      * @param output   Describe what the parameter does
  +      * @todo-javadoc   Write javadocs for method
  +      * @todo-javadoc   Write javadocs for method parameter
  +      */
  +     public final void print( String output )
  +     {
  +             if( out != null )
  +             {
  +                     out.print( output );
  +                     out.flush();
  +             }
  +     }
  +
  +     /**
         * The main template parsing/processing/running logic. It searches for
         * <XDoclet: string, parses what is found after it till a matching </XDoclet:
         * is found in case of a block tag, or till a /> is found in case of a content
  @@ -385,14 +401,14 @@
                        {
                                // we didn't find a tag.  print the rest of the 
template and finish
   
  -                             out.print( template.substring( prev_index ) );
  +                             print( template.substring( prev_index ) );
                                break;
                        }
                        else
                        {
                                // we found a tag.  print the template up to the tag 
start, and then handle the tag
   
  -                             out.print( template.substring( prev_index, index ) );
  +                             print( template.substring( prev_index, index ) );
                                prev_index = handleTag( index, template );
                        }
                }
  @@ -428,21 +444,6 @@
        }
   
        /**
  -      * Describe what the method does
  -      *
  -      * @param output   Describe what the parameter does
  -      * @todo-javadoc   Write javadocs for method
  -      * @todo-javadoc   Write javadocs for method parameter
  -      */
  -     public void print( String output )
  -     {
  -             if( out != null )
  -             {
  -                     out.print( output );
  -             }
  -     }
  -
  -     /**
         * A utility method used for generating the dest_file based on template_file
         * template file.
         *
  @@ -458,8 +459,6 @@
   
                if( content != null )
                {
  -                     cat.debug( "content.length()=" + content.length() );
  -
                        try
                        {
                                PrettyPrintWriter out = new PrettyPrintWriter( new 
BufferedWriter( new FileWriter( output ) ) );
  @@ -676,7 +675,7 @@
   
                if( result != null && out != null )
                {
  -                     out.print( result );
  +                     print( result );
                }
        }
   
  @@ -760,8 +759,6 @@
         */
        private int extractNextAttribute( final String template, int index, TagContext 
tagContext, Properties attributes ) throws TemplateException
        {
  -             Category cat = Log.getCategory( TemplateEngine.class, 
"extractNextAttribute" );
  -
                StringBuffer attr_name = new StringBuffer();
                StringBuffer attr_value = new StringBuffer();
                char quote_char = '"';
  @@ -847,8 +844,6 @@
                        }
                }
   
  -             if( cat.isDebugEnabled() )
  -                     cat.debug( "Attribute " + attr_name + "=" + attr_value );
                attributes.setProperty( attr_name.toString(), attr_value.toString() );
                return index;
        }
  
  
  

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

Reply via email to