Class GroovyScriptOutlet
- 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.GroovyScriptOutlet
-
- All Implemented Interfaces:
Outlet,TemplateOutlet
public class GroovyScriptOutlet extends GroovyOutlet
A Outlet which uses a groovy script 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 GroovyScriptOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding)Constructs a new GroovyScriptOutlet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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, 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
-
GroovyScriptOutlet
public GroovyScriptOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding) throws ConfigurationException
Constructs a new GroovyScriptOutlet.- 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: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.
-
-