|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.torque.generator.outlet.OutletImpl
org.apache.torque.generator.template.TemplateOutletImpl
org.apache.torque.generator.template.velocity.VelocityOutlet
public class VelocityOutlet
A Outlet which uses a velocity template for generation.
| Field Summary | |
|---|---|
static String |
NULL_KEY_CONTEXT_NAME
The key under which the null attribute of a source element is put into the context. |
static String |
STRING_UTILS_CONTEXT_NAME
The name under which the velocity StringUtils will be put into the context. |
static String |
TORQUE_GEN_CONTEXT_NAME
The name under which the Torque generator interface will be put into the context. |
| Constructor Summary | |
|---|---|
VelocityOutlet(QualifiedName name,
ConfigurationProvider configurationProvider,
String path,
String encoding)
Constructs a new VelocityTemplateOutlet. |
|
| Method Summary | |
|---|---|
OutletResult |
execute(ControllerState controllerState)
Executes the generation process; the result is returned. |
boolean |
isOptionsInContext()
Returns whether all options which namespaces are visible to the name space of this outlet are put into the context. |
boolean |
isSourceAttributesInContext()
Returns whether the attributes of the current source element are put into the context. |
boolean |
isVariablesInContext()
Returns whether all variables which are visible to this outlet are put into the context. |
void |
setOptionsInContext(boolean optionsInContext)
Tells the outlet to put all options which name space is visible to the namespace of this outlet into the context. |
void |
setSourceAttributesInContext(boolean sourceAttributesInContext)
Tells the outlet to put the attributes of the current source element into the context or not. |
void |
setVariablesInContext(boolean variablesInContext)
Tells the outlet to put all variables which are visible to this outlet into the context. |
| Methods inherited from class org.apache.torque.generator.template.TemplateOutletImpl |
|---|
getContent, load, toString |
| Methods inherited from class org.apache.torque.generator.outlet.OutletImpl |
|---|
addMergepointMapping, afterExecute, beforeExecute, getInputElementName, getMergepointMapping, getMergepointMappings, getName, getVariable, mergepoint, 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, getInputElementName, getMergepointMapping, getMergepointMappings, getName, setInputElementName, setMergepointMapping |
| Field Detail |
|---|
public static final String TORQUE_GEN_CONTEXT_NAME
public static final String STRING_UTILS_CONTEXT_NAME
public static final String NULL_KEY_CONTEXT_NAME
| Constructor Detail |
|---|
public VelocityOutlet(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.
May contain tokens of the form ${....}, these are parsed.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.| Method Detail |
|---|
public void setOptionsInContext(boolean optionsInContext)
optionsInContext - whether to put the options into the context.public boolean isOptionsInContext()
public void setVariablesInContext(boolean variablesInContext)
variablesInContext - whether to put the variables into the context.public boolean isVariablesInContext()
public void setSourceAttributesInContext(boolean sourceAttributesInContext)
sourceAttributesInContext - whether to put the source attributes
into the context.public boolean isSourceAttributesInContext()
public OutletResult execute(ControllerState controllerState)
throws GeneratorException
execute in interface Outletexecute in class OutletImplcontrollerState - the current controller state.
GeneratorException - if generation fails.Outlet.execute(ControllerState)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||