net.sf.jlayercheck.out.html
Class VelocityGenerator

java.lang.Object
  extended by net.sf.jlayercheck.out.html.VelocityGenerator

public class VelocityGenerator
extends Object

Prepares velocity and an initial context for a template.

Version:
$Id: VelocityGenerator.java 18 2007-05-08 21:49:53Z stuelten $
Author:
timo, $Author: stuelten $

Field Summary
protected  org.apache.velocity.VelocityContext context
          The VelocityContext for the template.
static String DEFAULT_ENCODING
          Use UTF-8 as default encoding for templates.
protected  String template
          The name of the template
 
Constructor Summary
VelocityGenerator()
          Create a new generator.
VelocityGenerator(String template, Map<String,Object> addCtx)
          Create a new generator for the given template
 
Method Summary
 void addToContext(Map<String,Object> addCtx)
          Add all entries to the context.
 void generate(Writer writer)
          Start generation and write output.
 org.apache.velocity.VelocityContext getContext()
          Get the current context or create a new empty one.
 String getTemplate()
           
 void setContext(org.apache.velocity.VelocityContext context)
          Set the context.
 void setTemplate(String template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
Use UTF-8 as default encoding for templates.

See Also:
Constant Field Values

template

protected String template
The name of the template


context

protected org.apache.velocity.VelocityContext context
The VelocityContext for the template.

Constructor Detail

VelocityGenerator

public VelocityGenerator()
Create a new generator.


VelocityGenerator

public VelocityGenerator(String template,
                         Map<String,Object> addCtx)
Create a new generator for the given template

Parameters:
template - The name of the template to use.
context - A Map with
Method Detail

getTemplate

public String getTemplate()

setTemplate

public void setTemplate(String template)

getContext

public org.apache.velocity.VelocityContext getContext()
Get the current context or create a new empty one.


setContext

public void setContext(org.apache.velocity.VelocityContext context)
Set the context.

Parameters:
context - the new context

addToContext

public void addToContext(Map<String,Object> addCtx)
Add all entries to the context.

Parameters:
addCtx - The map containing the entries

generate

public void generate(Writer writer)
Start generation and write output.

Parameters:
writer - write output into this writer


Copyright © 2007. All Rights Reserved.