Class Template

  • All Implemented Interfaces:
    Cloneable

    public class Template
    extends Resource
    implements Cloneable
    This class is used for controlling all template operations. This class uses a parser created by JavaCC to create an AST that is subsequently traversed by a Visitor.
     // set up and initialize Velocity before this code block
    
     Template template = Velocity.getTemplate("test.wm");
     Context context = new VelocityContext();
    
     context.put("foo", "bar");
     context.put("customer", new Customer());
    
     template.merge(context, writer);
     
    Version:
    $Id$
    Author:
    Jason van Zyl, Geir Magnusson Jr.