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
public class GroovyTemplateOutlet extends GroovyOutlet
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
Constructors Constructor Description GroovyTemplateOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding)
Constructs a new GroovyTemplateOutlet.
-
Method Summary
Modifier and Type Method Description protected String
executeGroovy(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, setVariablesInContext
-
Methods inherited from class org.apache.torque.generator.template.TemplateOutletImpl
getContent, getDetokenizedPath, getPath, load, toString
-
Methods inherited from class org.apache.torque.generator.outlet.OutletImpl
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.torque.generator.outlet.Outlet
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, setInputClass, setInputElementName, setMergepointMapping
-
-
-
-
Constructor Detail
-
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 Detail
-
executeGroovy
protected String executeGroovy(Map<String,Object> binding, ControllerState controllerState) throws GeneratorException
Description copied from class:GroovyOutlet
Executes the Groovy script or template and retuns the reult.- Specified by:
executeGroovy
in classGroovyOutlet
- Parameters:
binding
- the binding, not null.controllerState
- the controller state, not null.- Returns:
- the generation result.
- Throws:
GeneratorException
- if generation fails.
-
-