public class GroovyScriptOutlet extends GroovyOutlet
NULL_KEY_BINDING_NAME, TORQUE_GEN_BINDING_NAME
Constructor and Description |
---|
GroovyScriptOutlet(QualifiedName name,
ConfigurationProvider configurationProvider,
String path,
String encoding)
Constructs a new GroovyScriptOutlet.
|
Modifier and Type | Method and Description |
---|---|
protected String |
executeGroovy(Map<String,Object> binding,
ControllerState controllerState)
Executes the Groovy script or template and retuns the reult.
|
createBinding, execute, isOptionsInBinding, isSourceAttributesInBinding, isVariablesInBinding, setOptionsInBinding, setSourceAttributesInBinding, setVariablesInContext
getContent, getDetokenizedPath, getPath, load, toString
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addMergepointMapping, afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, setInputClass, setInputElementName, setMergepointMapping
public GroovyScriptOutlet(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding) throws ConfigurationException
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.NullPointerException
- if name, path or directories are null.ConfigurationException
- if an error occurs while reading the
template.protected String executeGroovy(Map<String,Object> binding, ControllerState controllerState) throws GeneratorException
GroovyOutlet
executeGroovy
in class GroovyOutlet
binding
- the binding, not null.controllerState
- the controller state, not null.GeneratorException
- if generation fails.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.