org.apache.torque.generator.outlet.java
Class NewlineOutlet

java.lang.Object
  extended by org.apache.torque.generator.outlet.OutletImpl
      extended by org.apache.torque.generator.outlet.java.OutletWithoutMergepoints
          extended by 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
static char CARRIAGE_RETURN
          The carriage return char '\r'.
static char NEWLINE
          The newline char '\r'.
 
Constructor Summary
NewlineOutlet(QualifiedName name)
          Constructor.
 
Method Summary
 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, getInputElementName, getMergepointMappings, getName, getVariable, mergepoint, setInputElementName, setMergepointMapping, setVariable, setVariable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 interface Outlet
Specified by:
execute in class OutletImpl
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.


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.