Class NewlineOutlet
- java.lang.Object
-
- org.apache.torque.generator.outlet.OutletImpl
-
- org.apache.torque.generator.outlet.java.OutletWithoutMergepoints
-
- org.apache.torque.generator.outlet.java.NewlineOutlet
-
- All Implemented Interfaces:
Outlet
public class NewlineOutlet extends OutletWithoutMergepoints
Creates new lines (\n or \r\n).
-
-
Field Summary
Fields Modifier and Type Field Description static char
CARRIAGE_RETURN
The carriage return char '\r'.static char
NEWLINE
The newline char '\r'.
-
Constructor Summary
Constructors Constructor Description NewlineOutlet(QualifiedName name)
Constructor.
-
Method Summary
Modifier and Type Method Description OutletResult
execute(ControllerState controllerState)
Generates the output for this template into the Generated object.int
getCount()
Returns how many newlines should be created.boolean
isWindowsStyle()
Returns whether windows newlines (\r\n) are used.void
setCount(int count)
Sets how many newlines should be created.void
setWindowsStyle(boolean windowsStyle)
Sets whether windows newlines (\r\n) are used.-
Methods inherited from class org.apache.torque.generator.outlet.java.OutletWithoutMergepoints
addMergepointMapping, getMergepointMapping
-
Methods inherited from class org.apache.torque.generator.outlet.OutletImpl
afterExecute, beforeExecute, getInputClass, getInputElementName, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariable, toString
-
-
-
-
Field Detail
-
CARRIAGE_RETURN
public static final char CARRIAGE_RETURN
The carriage return char '\r'.- See Also:
- Constant Field Values
-
NEWLINE
public static final char NEWLINE
The newline char '\r'.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NewlineOutlet
public NewlineOutlet(QualifiedName name)
Constructor.- Parameters:
name
- the qualified name of the outlet.
-
-
Method Detail
-
execute
public OutletResult execute(ControllerState controllerState) throws GeneratorException
Description copied from interface:Outlet
Generates the output for this template into the Generated object.- Specified by:
execute
in interfaceOutlet
- Specified by:
execute
in classOutletImpl
- Parameters:
controllerState
- the current controller state, not null.- Returns:
- the output of the Outlet.
- Throws:
GeneratorException
- if generation fails.
-
getCount
public int getCount()
Returns how many newlines should be created.- Returns:
- how many newlines should be created.
-
setCount
public void setCount(int count)
Sets how many newlines should be created.- Parameters:
count
- how many newlines should be created.
-
isWindowsStyle
public boolean isWindowsStyle()
Returns whether windows newlines (\r\n) are used.- Returns:
- whether windows newlines are used.
-
setWindowsStyle
public void setWindowsStyle(boolean windowsStyle)
Sets whether windows newlines (\r\n) are used.- Parameters:
windowsStyle
- whether windows newlines should be used.
-
-