| java.lang.Object org.apache.velocity.runtime.resource.Resource org.apache.velocity.Template
Template | public class Template extends Resource (Code) | | 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);
author: Jason van Zyl author: Geir Magnusson Jr. version: $Id: Template.java 490011 2006-12-24 12:19:09Z henning $ |
Method Summary | |
public void | initDocument() initializes the document. | public void | merge(Context context, Writer writer) The AST node structure is merged with the
context to produce the final output. | public boolean | process() |
Template | public Template()(Code) | | Default constructor
|
initDocument | public void initDocument() throws TemplateInitException(Code) | | initializes the document. init() is not longer
dependant upon context, but we need to let the
init() carry the template name down throught for VM
namespace features
throws: TemplateInitException - When a problem occurs during the document initialization. |
|
|