|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.generator.outlet.java.OutletUtils
public final class OutletUtils
Utility methods to retrieve information out of the source model or the configuration. The methods provide adequate logging and error handling.
Method Summary | |
---|---|
static String |
getFromDifferentPlaces(String presetValue,
String optionName,
String variableName,
String sourceElementName,
String sourceElementAttribute,
ControllerState controllerState,
Class<?> clazz,
String expectedFieldNames)
Retrieve a value from either a preset value, an option, a variable, or a source element attribute. |
static String |
getOption(String optionName,
ControllerState controllerState,
Class<?> clazz)
Reads an option with a given name. |
static String |
getSourceElementAttribute(String elementName,
String attributeName,
ControllerState controllerState,
Class<?> clazz)
Retrieves the value of a source element attribute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String getSourceElementAttribute(String elementName, String attributeName, ControllerState controllerState, Class<?> clazz) throws GeneratorException
elementName
- The name of the source element relative to the
current source element; a dot (.) denotes the current element.attributeName
- The name of the attribute of the element.controllerState
- The controller state.clazz
- the class in which the attribute should be retrieved;
used only for logging.
GeneratorException
- if the source element cannot be found
or the specified attribute is not set.public static String getOption(String optionName, ControllerState controllerState, Class<?> clazz) throws GeneratorException
optionName
- the name of the option to read, not null.controllerState
- the current state of the controller, not null.clazz
- the class from which this method is called, not null.
Only used for logging purposes.
GeneratorException
- if the option is not set or set to null.public static String getFromDifferentPlaces(String presetValue, String optionName, String variableName, String sourceElementName, String sourceElementAttribute, ControllerState controllerState, Class<?> clazz, String expectedFieldNames) throws GeneratorException
presetValue
- the plain result, or null if the preset value should
not be used.optionName
- the name of the option to access, or null if
no option value should be returned.variableName
- the name of the variable to access, or null if
no variable should be accessed.sourceElementName
- the name of the source element relative to the
current element which attribute should be read. Null if no source
attribute value should be used.sourceElementAttribute
- the name of the attribute of the above
source element.controllerState
- the current state of the controller, not null.clazz
- the class from which this method is called, not null.
Used only for logging purposes.expectedFieldNames
- the field names in which the information
is expected; for logging purposes only.
GeneratorException
- if the value is not set or more than one
possibility to get the value exists.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |