org.javagen.agile.core.emitter.template
Class VelocityCodeGenerator

java.lang.Object
  extended by org.javagen.agile.core.emitter.template.VelocityCodeGenerator
All Implemented Interfaces:
TemplateGenerator

public class VelocityCodeGenerator
extends Object
implements TemplateGenerator

Velocity template implementation.

Author:
Richard Easterling

Field Summary
static String DEFAULT_TEMPLATE_LOCATION_PATH
           
static String TEMPLATE_FILE_EXTENSION
           
protected  String templateBasePath
           
(package private)  String tempTemplate
           
static String VELOCITY_PROPERTIES_FILE
           
(package private)  org.apache.velocity.app.VelocityEngine vengine
           
protected  WriterFactory writerFactory
           
 
Constructor Summary
VelocityCodeGenerator()
           
 
Method Summary
 void gen(String templatePath, File outFile, Map<String,Object> context)
          Process templates.
 String getTemplateBasePath()
          Base path of template locations.
 WriterFactory getWriterFactory()
           
 void setTemplateBasePath(String templateBasePath)
           
 void setWriterFactory(WriterFactory writerFactory)
          Provide a hook for tools to intercept the output sinks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEMPLATE_LOCATION_PATH

public static final String DEFAULT_TEMPLATE_LOCATION_PATH
See Also:
Constant Field Values

TEMPLATE_FILE_EXTENSION

public static final String TEMPLATE_FILE_EXTENSION
See Also:
Constant Field Values

VELOCITY_PROPERTIES_FILE

public static final String VELOCITY_PROPERTIES_FILE
See Also:
Constant Field Values

templateBasePath

protected String templateBasePath

vengine

org.apache.velocity.app.VelocityEngine vengine

writerFactory

protected WriterFactory writerFactory

tempTemplate

String tempTemplate
Constructor Detail

VelocityCodeGenerator

public VelocityCodeGenerator()
Method Detail

gen

public void gen(String templatePath,
                File outFile,
                Map<String,Object> context)
Process templates.

Specified by:
gen in interface TemplateGenerator
Parameters:
templatePath - relative to templateBasePath
outFile - output file
context - usualy a combined context based on current model node.

getTemplateBasePath

public String getTemplateBasePath()
Description copied from interface: TemplateGenerator
Base path of template locations.

Specified by:
getTemplateBasePath in interface TemplateGenerator

setTemplateBasePath

public void setTemplateBasePath(String templateBasePath)

setWriterFactory

public void setWriterFactory(WriterFactory writerFactory)
Description copied from interface: TemplateGenerator
Provide a hook for tools to intercept the output sinks.

Specified by:
setWriterFactory in interface TemplateGenerator

getWriterFactory

public WriterFactory getWriterFactory()


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.