org.apache.velocity.texen
public class Generator extends Object
Version: $Id: Generator.java,v 1.20.4.1 2004/03/03 23:23:07 geirm Exp $
Field Summary | |
---|---|
Context | controlContext
Context used for generating the texen output. |
static String | DEFAULT_TEXEN_PROPERTIES
Default properties file used for controlling the
tools placed in the context. |
protected String | inputEncoding
This is the encoding for the input file(s)
(templates). |
static Generator | instance
The generator tools used for creating additional
output withing the control template. |
protected String | outputEncoding
This is the encoding for the output file(s). |
static String | OUTPUT_PATH
Where the texen output will placed. |
Properties | props
Default properties used by texen. |
static String | TEMPLATE_PATH
Where the velocity templates live. |
protected VelocityEngine | ve
Velocity engine. |
Hashtable | writers
Keep track of the file writers used for outputting
to files. |
Constructor Summary | |
---|---|
Generator()
Default constructor. | |
Generator(String propFile)
Create a new generator object with properties loaded from
a file. | |
Generator(Properties props)
Create a new Generator object with a given property
set. |
Method Summary | |
---|---|
protected void | fillContextDefaults(Context context)
Add properties that will aways be in the context by default
|
protected void | fillContextHash(Context context, Hashtable objs)
Add all the contents of a Hashtable to the context.
|
protected void | fillContextProperties(Context context)
Add objects to the context from the current properties.
|
protected Context | getContext(Hashtable objs)
Create a new context and fill it with the elements of the
objs Hashtable. |
static Generator | getInstance()
Create a new generator object with default properties.
|
String | getOutputPath()
Get the output path for the generated
output.
|
Template | getTemplate(String templateName, String encoding)
Returns a template, based on encoding and path.
|
String | getTemplatePath()
Get the template path.
|
Writer | getWriter(String path, String encoding)
Returns a writer, based on encoding and path.
|
String | parse(String inputTemplate, String outputFile)
Parse an input and write the output to an output file. |
String | parse(String inputTemplate, String outputFile, String objectID, Object object)
Parse an input and write the output to an output file. |
String | parse(String inputTemplate, String intputEncoding, String outputFile, String outputEncoding, String objectID, Object object)
Parse an input and write the output to an output file. |
String | parse(String controlTemplate, Context controlContext)
Parse the control template and merge it with the control
context. |
protected void | setDefaultProps()
Set default properties. |
void | setInputEncoding(String inputEncoding)
Set the input (template) encoding. |
void | setOutputEncoding(String outputEncoding)
Set the output encoding. |
void | setOutputPath(String outputPath)
Set the output path for the generated
output.
|
void | setTemplatePath(String templatePath)
Set the template path, where Texen will look
for Velocity templates.
|
void | setVelocityEngine(VelocityEngine ve)
Set the velocity engine. |
void | shutdown()
Properly shut down the generator, right now
this is simply flushing and closing the file
writers that we have been holding on to. |
Parameters: String properties used to help populate the control context.
Returns: Generator generator used in the control context.
Parameters: Properties properties object to help populate the control context.
Parameters: Context control context to fill with default values.
Parameters: Context context to fill with objects Hashtable source of objects
Parameters: Context control context to fill with objects that are specified in the default.properties file
Parameters: Hashtable objects to place in the control context
Returns: Context context filled with objects
Returns: Generator generator used in the control context.
Returns: String output path for texen output.
Parameters: templateName name of the template encoding template encoding
Returns: String template path for velocity templates.
Parameters: path path to the output file encoding output encoding
Parameters: String input template String output file
Parameters: String input template String output file String id for object to be placed in the control context String object to be placed in the context
Returns: String generated output from velocity
Parameters: String input template String inputEncoding template encoding String output file String outputEncoding encoding of output file String id for object to be placed in the control context String object to be placed in the context
Returns: String generated output from velocity
Parameters: String control template Context control context
Returns: String generated output
Returns: String output path for texen output.
Parameters: String template path for velocity templates.