Class VelocityTemplate
- java.lang.Object
-
- org.apache.maven.plugins.checkstyle.rss.VelocityTemplate
-
public class VelocityTemplate extends java.lang.ObjectA 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;
- Author:
- Joakim Erdfelt
-
-
Constructor Summary
Constructors Constructor Description VelocityTemplate(org.codehaus.plexus.velocity.VelocityComponent velocityComponent, java.lang.String templateBaseDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerate(java.lang.String outputFilename, java.lang.String template, Context context)Using a specified Velocity Template and provided context, create the outputFilename.LoggetLog()java.lang.StringgetTemplateDirectory()org.codehaus.plexus.velocity.VelocityComponentgetVelocity()voidsetLog(Log log)voidsetTemplateDirectory(java.lang.String templateDirectory)voidsetVelocity(org.codehaus.plexus.velocity.VelocityComponent velocity)
-
-
-
Method Detail
-
getTemplateDirectory
public java.lang.String getTemplateDirectory()
-
getVelocity
public org.codehaus.plexus.velocity.VelocityComponent getVelocity()
-
generate
public void generate(java.lang.String outputFilename, java.lang.String template, Context context) throws VelocityException, MojoExecutionException, java.io.IOExceptionUsing 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:
VelocityException- if the template was not found or any other Velocity exception.MojoExecutionException- if merging the velocity template failed.java.io.IOException- if there was an error when writing to the output file.
-
setTemplateDirectory
public void setTemplateDirectory(java.lang.String templateDirectory)
-
setVelocity
public void setVelocity(org.codehaus.plexus.velocity.VelocityComponent velocity)
-
getLog
public Log getLog()
-
setLog
public void setLog(Log log)
-
-