org.apache.maven.plugin.checkstyle

Class VelocityTemplate

public class VelocityTemplate extends Object

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
  * @parameter expression="${component.org.codehaus.plexus.velocity.VelocityComponent}"
  * @readonly
  */
  private VelocityComponent velocity;
 

Author: Joakim Erdfelt

Constructor Summary
VelocityTemplate(VelocityComponent velocityComponent, String templateBaseDirectory)
Method Summary
voidgenerate(String outputFilename, String template, Context context)
Using a specified Velocity Template and provided context, create the outputFilename.
LoggetLog()
StringgetTemplateDirectory()
VelocityComponentgetVelocity()
voidsetLog(Log log)
voidsetTemplateDirectory(String templateDirectory)
voidsetVelocity(VelocityComponent velocity)

Constructor Detail

VelocityTemplate

public VelocityTemplate(VelocityComponent velocityComponent, String templateBaseDirectory)

Method Detail

generate

public void generate(String outputFilename, String template, Context context)
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: ResourceNotFoundException if the template was not found. VelocityException if the MojoExecutionException IOException

getLog

public Log getLog()

getTemplateDirectory

public String getTemplateDirectory()

getVelocity

public VelocityComponent getVelocity()

setLog

public void setLog(Log log)

setTemplateDirectory

public void setTemplateDirectory(String templateDirectory)

setVelocity

public void setVelocity(VelocityComponent velocity)
Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.