Class VelocityTemplate
java.lang.Object
org.apache.maven.plugins.checkstyle.rss.VelocityTemplate
A component to work with VelocityTemplates from within plugins.
You will need to reference the velocity component as a parameter in your plugin. Like this:
/** * Velocity Component * @component */ private VelocityComponent velocity;
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.maven.plugin.logging.Log
private String
private org.codehaus.plexus.velocity.VelocityComponent
-
Constructor Summary
ConstructorsConstructorDescriptionVelocityTemplate
(org.codehaus.plexus.velocity.VelocityComponent velocityComponent, String templateBaseDirectory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Using a specified Velocity Template and provided context, create the outputFilename.org.apache.maven.plugin.logging.Log
getLog()
org.codehaus.plexus.velocity.VelocityComponent
void
setLog
(org.apache.maven.plugin.logging.Log log) void
setTemplateDirectory
(String templateDirectory) void
setVelocity
(org.codehaus.plexus.velocity.VelocityComponent velocity)
-
Field Details
-
templateDirectory
-
log
private org.apache.maven.plugin.logging.Log log -
velocity
private org.codehaus.plexus.velocity.VelocityComponent velocity
-
-
Constructor Details
-
VelocityTemplate
public VelocityTemplate(org.codehaus.plexus.velocity.VelocityComponent velocityComponent, String templateBaseDirectory)
-
-
Method Details
-
getTemplateDirectory
-
getVelocity
public org.codehaus.plexus.velocity.VelocityComponent getVelocity() -
generate
public void generate(String outputFilename, String template, org.apache.velocity.context.Context context) throws org.apache.velocity.exception.VelocityException, org.apache.maven.plugin.MojoExecutionException, IOException Using a specified Velocity Template and provided context, create the outputFilename.- Parameters:
outputFilename
- the file to be generated.template
- the velocity template to use.context
- the velocity context map.- Throws:
org.apache.velocity.exception.VelocityException
- if the template was not found or any other Velocity exception.org.apache.maven.plugin.MojoExecutionException
- if merging the velocity template failed.IOException
- if there was an error when writing to the output file.
-
setTemplateDirectory
-
setVelocity
public void setVelocity(org.codehaus.plexus.velocity.VelocityComponent velocity) -
getLog
public org.apache.maven.plugin.logging.Log getLog() -
setLog
public void setLog(org.apache.maven.plugin.logging.Log log)
-