User: rinkrank
  Date: 02/02/22 08:28:21

  Modified:    core/src/xdoclet/template TemplateParser.java
                        TemplateEngine.java
  Log:
  -renamed the setTemplateFile(URL) to setTemplateURL(URL)
  -changed File getTemplateFile() to URL getTemplateURL()
  
  This was needed for backwards compatibility. The TemplateSubTask still has
  a setTemplateURL that is called from Ant, and this method converts the File to an URL
  and calls setTemplateURL.
  
  Revision  Changes    Path
  1.4       +3 -3      xdoclet/core/src/xdoclet/template/TemplateParser.java
  
  Index: TemplateParser.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/template/TemplateParser.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- TemplateParser.java       11 Feb 2002 00:08:07 -0000      1.3
  +++ TemplateParser.java       22 Feb 2002 16:28:21 -0000      1.4
  @@ -21,7 +21,7 @@
    *
    * @author    Vincent Harcq ([EMAIL PROTECTED])
    * @created   December 27, 2001
  - * @version   $Revision: 1.3 $
  + * @version   $Revision: 1.4 $
    */
   public class TemplateParser
         extends TemplateEngine
  @@ -62,7 +62,7 @@
        {
                Category cat = Log.getCategory( TemplateParser.class, "start" );
   
  -             String content = FileManager.getURLContent( getTemplateFile() );
  +             String content = FileManager.getURLContent( getTemplateURL() );
   
                if( content != null )
                {
  @@ -73,7 +73,7 @@
                }
                else
                {
  -                     String msg = Translator.getString( "template_not_found", new 
String[]{getTemplateFile().toString()} );
  +                     String msg = Translator.getString( "template_not_found", new 
String[]{getTemplateURL().toString()} );
   
                        cat.error( msg );
                        throw new TemplateException( msg );
  
  
  
  1.17      +26 -26    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.16
  retrieving revision 1.17
  diff -u -w -r1.16 -r1.17
  --- TemplateEngine.java       20 Feb 2002 00:13:14 -0000      1.16
  +++ TemplateEngine.java       22 Feb 2002 16:28:21 -0000      1.17
  @@ -31,7 +31,7 @@
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @author    Dmitri Colebatch ([EMAIL PROTECTED])
    * @created   July 14, 2001
  - * @version   $Revision: 1.16 $
  + * @version   $Revision: 1.17 $
    * @see       #generate(java.lang.String)
    */
   public class TemplateEngine
  @@ -57,7 +57,7 @@
        /**
         * The template file currently being processed.
         */
  -     private transient URL templateFile = null;
  +     private transient URL templateURL = null;
   
        private transient TemplateContext context = null;
   
  @@ -196,9 +196,9 @@
         * @return   The TemplateFile value
         * @see      #setTemplateFile(java.net.URL)
         */
  -     public URL getTemplateFile()
  +     public URL getTemplateURL()
        {
  -             return templateFile;
  +             return templateURL;
        }
   
        public File getOutput()
  @@ -255,14 +255,14 @@
   
        /**
         * A config parameter settable from Ant build file. It sets the current
  -      * template file to templateFile, so thereafter the new template file is used.
  +      * template file to templateURL, so thereafter the new template file is used.
         *
  -      * @param templateFile  The new TemplateFile value
  -      * @see                 #getTemplateFile()
  +      * @param templateURL  The new TemplateFile value
  +      * @see                #getTemplateURL()
         */
  -     public void setTemplateFile( URL templateFile )
  +     public void setTemplateURL( URL templateURL )
        {
  -             this.templateFile = templateFile;
  +             this.templateURL = templateURL;
        }
   
        public void setOutput( File output )
  @@ -384,7 +384,7 @@
   
                output.getParentFile().mkdirs();
   
  -             String content = FileManager.getURLContent( getTemplateFile() );
  +             String content = FileManager.getURLContent( getTemplateURL() );
   
                if( content != null )
                {
  @@ -409,7 +409,7 @@
                }
                else
                {
  -                     String msg = Translator.getString( "template_not_found", new 
String[]{getTemplateFile().toString()} );
  +                     String msg = Translator.getString( "template_not_found", new 
String[]{getTemplateURL().toString()} );
   
                        cat.error( msg );
                        throw new TemplateException( msg );
  @@ -442,7 +442,7 @@
                // extract the tag name, keeping track of where we are in the template
                i = extractTagName( template, i, cmd );
   
  -             // cat.debug( "Found " + cmd.toString() + ", line=" + getLineNumber( 
template, i ) + " of template file: " + getTemplateFile() );
  +             // cat.debug( "Found " + cmd.toString() + ", line=" + getLineNumber( 
template, i ) + " of template file: " + getTemplateURL() );
   
                // do an initial parse of the tag
                i = doInitialTagParse( template, i, tagContext );
  @@ -530,7 +530,7 @@
                if( template.charAt( index ) == '=' )
                        index++;
                else
  -                     throw new TemplateException( Translator.getString( 
"template_equals_expected", new String[]{Integer.toString( getLineNumber( template, 
index ) ), getTemplateFile().toString()} ) );
  +                     throw new TemplateException( Translator.getString( 
"template_equals_expected", new String[]{Integer.toString( getLineNumber( template, 
index ) ), getTemplateURL().toString()} ) );
   
                index = skipWhitespace( template, index );
   
  @@ -546,7 +546,7 @@
                        quote_char = '\'';
                }
                else
  -                     throw new TemplateException( Translator.getString( 
"template_quote_expected", new String[]{Integer.toString( getLineNumber( template, 
index ) ), getTemplateFile().toString()} ) );
  +                     throw new TemplateException( Translator.getString( 
"template_quote_expected", new String[]{Integer.toString( getLineNumber( template, 
index ) ), getTemplateURL().toString()} ) );
   
                //read attribute value
                while( template.charAt( index ) != quote_char )
  @@ -585,7 +585,7 @@
                                //no more attributes
                        }
                        else
  -                             throw new TemplateException( Translator.getString( 
"template_gt_expected", new String[]{Integer.toString( getLineNumber( template, index 
) ), getTemplateFile().toString()} ) );
  +                             throw new TemplateException( Translator.getString( 
"template_gt_expected", new String[]{Integer.toString( getLineNumber( template, index 
) ), getTemplateURL().toString()} ) );
                }
   
                cat.debug( "Attribute " + attr_name + "=" + attr_value );
  @@ -627,7 +627,7 @@
                                        return index;
                                }
                                else
  -                                     throw new TemplateException( 
Translator.getString( "template_gt_expected", new String[]{Integer.toString( 
getLineNumber( template, index ) ), getTemplateFile().toString()} ) );
  +                                     throw new TemplateException( 
Translator.getString( "template_gt_expected", new String[]{Integer.toString( 
getLineNumber( template, index ) ), getTemplateURL().toString()} ) );
                        }
                        else if( Character.isWhitespace( template.charAt( index ) ) )
                        {
  @@ -672,7 +672,7 @@
                        if( body_end_index == -1 )
                        {
                                throw new TemplateException( Translator.getString( 
"template_close_tag_missing",
  -                                     new String[]{XDOCLET_TAIL + cmd + ">", 
Integer.toString( getLineNumber( template, index ) ), getTemplateFile().toString()} ) 
);
  +                                     new String[]{XDOCLET_TAIL + cmd + ">", 
Integer.toString( getLineNumber( template, index ) ), getTemplateURL().toString()} ) );
                        }
                        else
                                open_nested_elem_count--;
  @@ -698,7 +698,7 @@
                                        open_nested_elem_count++;
                                else
                                        throw new TemplateException( 
Translator.getString( "template_corresponding_tag_missing",
  -                                             new String[]{XDOCLET_TAIL + cmd + ">", 
Integer.toString( getLineNumber( template, index ) ), getTemplateFile().toString()} ) 
);
  +                                             new String[]{XDOCLET_TAIL + cmd + ">", 
Integer.toString( getLineNumber( template, index ) ), getTemplateURL().toString()} ) );
   
                                nested_start_index = template.indexOf( XDOCLET_PREFIX 
+ cmd, nested_start_index + 1 );
                        }
  @@ -772,16 +772,16 @@
                                throw ( TemplateException ) e.getTargetException();
                        else
                        {
  -                             cat.error( "Invoking method failed: " + methodName + 
", line=" + getLineNumber( template, i ) + " of template file: " + getTemplateFile(), 
e );
  +                             cat.error( "Invoking method failed: " + methodName + 
", line=" + getLineNumber( template, i ) + " of template file: " + getTemplateURL(), e 
);
                                throw new TemplateException( Translator.getString( 
"template_invoke_method_failed",
  -                                     new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateFile().toString(), e.getMessage()} ) );
  +                                     new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateURL().toString(), e.getMessage()} ) );
                        }
                }
                catch( IllegalAccessException e )
                {
  -                     cat.error( "Invoking method failed: " + methodName + ", line=" 
+ getLineNumber( template, i ) + " of template file: " + getTemplateFile(), e );
  +                     cat.error( "Invoking method failed: " + methodName + ", line=" 
+ getLineNumber( template, i ) + " of template file: " + getTemplateURL(), e );
                        throw new TemplateException( Translator.getString( 
"template_invoke_method_failed",
  -                             new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateFile().toString(), e.getMessage()} ) );
  +                             new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateURL().toString(), e.getMessage()} ) );
                }
                catch( NoSuchMethodException e )
                {
  @@ -808,16 +808,16 @@
                                        throw ( TemplateException ) 
e2.getTargetException();
                                else
                                {
  -                                     cat.error( "Invoking method failed: " + 
methodName + ", line=" + getLineNumber( template, i ) + " of template file: " + 
getTemplateFile(), e2 );
  +                                     cat.error( "Invoking method failed: " + 
methodName + ", line=" + getLineNumber( template, i ) + " of template file: " + 
getTemplateURL(), e2 );
                                        throw new TemplateException( 
Translator.getString( "template_invoke_method_failed",
  -                                             new String[]{methodName, 
Integer.toString( getLineNumber( template, i ) ), getTemplateFile().toString(), 
e2.getMessage()} ) );
  +                                             new String[]{methodName, 
Integer.toString( getLineNumber( template, i ) ), getTemplateURL().toString(), 
e2.getMessage()} ) );
                                }
                        }
                        catch( IllegalAccessException e2 )
                        {
  -                             cat.error( "Invoking method failed: " + methodName + 
", line=" + getLineNumber( template, i ) + " of template file: " + getTemplateFile(), 
e2 );
  +                             cat.error( "Invoking method failed: " + methodName + 
", line=" + getLineNumber( template, i ) + " of template file: " + getTemplateURL(), 
e2 );
                                throw new TemplateException( Translator.getString( 
"template_invoke_method_failed",
  -                                     new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateFile().toString(), e2.getMessage()} ) );
  +                                     new String[]{methodName, Integer.toString( 
getLineNumber( template, i ) ), getTemplateURL().toString(), e2.getMessage()} ) );
                        }
                }
        }
  
  
  

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

Reply via email to