|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvdoclet.Generator
A file-generator using Velocity
Constructor Summary | |
Generator(File outputDir)
Construct a new generator. |
|
Generator(File outputDir,
ClassLoader templateClassLoader)
Construct a new generator. |
Method Summary | |
void |
eval(String templateName,
String fileName)
Evaluate a Velocity template. |
void |
eval(String templateName,
Writer writer)
Evaluate a Velocity template. |
org.apache.velocity.context.Context |
getContext()
Get the evaluation-context used by this generator |
protected org.apache.velocity.app.VelocityEngine |
getEngine()
Get the VelocityEngine used by this generator |
protected FileWriter |
getFileWriter(String fileName)
Get a Writer to the specified File |
File |
getOutputDir()
Get the output directory |
Object |
makeBean(String className)
Create an instance of the named class. |
void |
setAttribute(String key,
Object value)
Add something to the Generator's evaluation-context |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Generator(File outputDir, ClassLoader templateClassLoader) throws GeneratorException
outputDir
- base-directory for outputtemplateClassLoader
- class-loader used to find templatespublic Generator(File outputDir) throws GeneratorException
outputDir
- base-directory for outputMethod Detail |
protected org.apache.velocity.app.VelocityEngine getEngine()
public File getOutputDir()
protected FileWriter getFileWriter(String fileName) throws IOException
fileName
- a File
IOException
public org.apache.velocity.context.Context getContext()
public void setAttribute(String key, Object value)
public void eval(String templateName, Writer writer) throws IOException, GeneratorException
templateName
- name of the templatewriter
- output destination
IOException
GeneratorException
public void eval(String templateName, String fileName) throws IOException, GeneratorException
templateName
- name of the templatefileName
- name of output file
IOException
GeneratorException
public Object makeBean(String className) throws Exception
className
- the name of the class to instantiate
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |