Class GroovyTemplateOutlet
java.lang.Object
org.apache.torque.generator.outlet.OutletImpl
org.apache.torque.generator.template.TemplateOutletImpl
org.apache.torque.generator.template.groovy.GroovyOutlet
org.apache.torque.generator.template.groovy.GroovyTemplateOutlet
- All Implemented Interfaces:
Outlet,TemplateOutlet
A Outlet which uses a groovy template for generation.
-
Field Summary
Fields inherited from class org.apache.torque.generator.template.groovy.GroovyOutlet
NULL_KEY_BINDING_NAME, TORQUE_GEN_BINDING_NAME -
Constructor Summary
ConstructorsConstructorDescriptionGroovyTemplateOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding) Constructs a new GroovyTemplateOutlet. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringexecuteGroovy(Map<String, Object> binding, ControllerState controllerState) Executes the Groovy script or template and retuns the reult.Methods inherited from class org.apache.torque.generator.template.groovy.GroovyOutlet
createBinding, execute, isOptionsInBinding, isSourceAttributesInBinding, isVariablesInBinding, setOptionsInBinding, setSourceAttributesInBinding, setVariablesInContextMethods inherited from class org.apache.torque.generator.template.TemplateOutletImpl
getContent, getDetokenizedPath, getPath, load, toStringMethods inherited from class org.apache.torque.generator.outlet.OutletImpl
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.torque.generator.outlet.Outlet
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, setInputClass, setInputElementName, setMergepointMapping
-
Constructor Details
-
GroovyTemplateOutlet
public GroovyTemplateOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding) throws ConfigurationException Constructs a new GroovyTemplateOutlet.- Parameters:
name- the name of this outlet, not null.configurationProvider- the provider for reading the templates, not null.path- the path to the templates, not null.encoding- the encoding of the file, or null if the system's default encoding should be used.- Throws:
NullPointerException- if name, path or directories are null.ConfigurationException- if an error occurs while reading the template.
-
-
Method Details
-
executeGroovy
protected String executeGroovy(Map<String, Object> binding, ControllerState controllerState) throws GeneratorExceptionDescription copied from class:GroovyOutletExecutes the Groovy script or template and retuns the reult.- Specified by:
executeGroovyin classGroovyOutlet- Parameters:
binding- the binding, not null.controllerState- the controller state, not null.- Returns:
- the generation result.
- Throws:
GeneratorException- if generation fails.
-