Class ModifySourcenameOutlet
java.lang.Object
org.apache.torque.generator.outlet.OutletImpl
org.apache.torque.generator.outlet.java.ModifySourcenameOutlet
- All Implemented Interfaces:
Outlet
Creates a target filename from a source filename.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(ControllerState controllerState) Generates the output for this template into the Generated object.Returns the character sequence which separates the discarded beginning of the source filename from the returned end.The character sequence from the beginning of the source filename to and including the last occurrence of the returned string is discarded for the result.Returns the prefix which is added in front of the modified source filename.Returns the suffix which is added after the modified source filename.voidsetDiscardFrom(String discardFrom) Sets the character sequence which separates the discarded beginning of the source filename from the returned end.voidsetDiscardTo(String discardTo) Sets the character sequence after which last occurrence the source filename is returned.voidSets the prefix which is added in front of the modified source filename.voidSets the suffix which is added after the modified source filename.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, toString
-
Constructor Details
-
ModifySourcenameOutlet
Constructor.- Parameters:
qualifiedName- the qualified name of the outlet, not null.
-
-
Method Details
-
execute
Description copied from interface:OutletGenerates the output for this template into the Generated object.- Specified by:
executein interfaceOutlet- Specified by:
executein classOutletImpl- Parameters:
controllerState- the current controller state, not null.- Returns:
- the output of the Outlet.
- Throws:
GeneratorException- if generation fails.
-
getPrefix
Returns the prefix which is added in front of the modified source filename.- Returns:
- the prefix, not null
-
setPrefix
Sets the prefix which is added in front of the modified source filename.- Parameters:
prefix- the prefix, not null.- Throws:
NullPointerException- if prefix is null.
-
getSuffix
Returns the suffix which is added after the modified source filename.- Returns:
- the suffix, not null.
-
setSuffix
Sets the suffix which is added after the modified source filename.- Parameters:
suffix- the suffix, not null- Throws:
NullPointerException- if suffix is null.
-
getDiscardFrom
Returns the character sequence which separates the discarded beginning of the source filename from the returned end.Example: if the source filename is "xyz.a.b.c", and discardFrom is ".", then "xyz" will be returned.
- Returns:
- the character sequence from whose first occurrence the source filename is discarded.
-
setDiscardFrom
Sets the character sequence which separates the discarded beginning of the source filename from the returned end.Example: if the source filename is "xyz.a.b.c", and discardFrom is ".", then "xyz" will be returned.
- Parameters:
discardFrom- the character sequence from whose first occurrence the source filename is discarded.
-
getDiscardTo
The character sequence from the beginning of the source filename to and including the last occurrence of the returned string is discarded for the result.Example: if the source filename is "xyz.a.b.c", and discardTo is ".", then "c" will be returned.
- Returns:
- the character sequence up to whose last occurrence the source filename is discarded.
-
setDiscardTo
Sets the character sequence after which last occurrence the source filename is returned.Example: if the source filename is "xyz.a.b.c", and discardTo is ".", then "c" will be returned.
- Parameters:
discardTo- the character sequence up to whose last occurrence the source filename is discarded.
-