geirm       00/12/03 18:10:18

  Modified:    src/java/org/apache/velocity Template.java
  Log:
  Added initDocument() call to support Rutime() init-ing the template immediately 
after parse.
  
  Revision  Changes    Path
  1.15      +12 -12    jakarta-velocity/src/java/org/apache/velocity/Template.java
  
  Index: Template.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/Template.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Template.java     2000/11/16 01:43:16     1.14
  +++ Template.java     2000/12/04 02:10:18     1.15
  @@ -83,7 +83,8 @@
    * </pre>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  - * @version $Id: Template.java,v 1.14 2000/11/16 01:43:16 jvanzyl Exp $
  + * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  + * @version $Id: Template.java,v 1.15 2000/12/04 02:10:18 geirm Exp $
    */
   public class Template
   {
  @@ -175,6 +176,16 @@
       }        
   
       /**
  +     *  initializes the document.  init() is not longer 
  +     *  dependant upon context.
  +     */
  +    public void initDocument()
  +        throws Exception
  +    {
  +        document.init( null, null);
  +    }
  +
  +    /**
        * Is it time to check to see if the template
        * source has been updated?
        */
  @@ -268,17 +279,6 @@
       public void merge(Context context, Writer writer)
           throws IOException, Exception
       {
  -        synchronized(this)
  -        {
  -            if (!initialized)
  -            {
  -                Context initContext = (Context) context.clone();
  -                document.init(initContext, null);
  -                initialized = true;
  -                initContext = null;
  -            }
  -        }                
  -        
           document.render(context, writer);
       }
   }
  
  
  

Reply via email to