de.betabeans.scroogexhtml.converter
Class Formatter

java.lang.Object
  extended by de.betabeans.scroogexhtml.converter.Formatter

public final class Formatter
extends java.lang.Object

A class which controls line breaks and indentation for the generated output document. This class uses by default a CR LF sequence for a new line, and two spaces for indentation.


Field Summary
static int LEVEL0
          No indentation.
static int LEVEL1
          First indentation level.
static int LEVEL2
          Second indentation level.
static int LEVEL3
          Third indentation level.
static int LEVEL4
          Fourth indentation level.
 
Constructor Summary
Formatter()
           
 
Method Summary
 java.lang.String add(java.lang.String newLine)
          Return the indented string, followed by the line separator.
 java.lang.String getIndent(int level)
          Get an indent string for the given level.
 int getIndentLevel()
          Get the current indentation level.
 java.lang.String getNewLine()
          Get the line separator.
 java.lang.String indent(java.lang.String newLine)
          Increment the indentation level and return the indented string, followed by the line separator.
 void setIndentLevel(int newValue)
          Set the indentation level..
 void setNewLine(java.lang.String newValue)
          set the line separator.
 void setSpaces(java.lang.String newValue)
          Specifies the spaces value.
 java.lang.String unIndent(java.lang.String newLine)
          Decrement the indentation level and return the indented string, followed by the line separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL0

public static final int LEVEL0
No indentation.

See Also:
Constant Field Values

LEVEL1

public static final int LEVEL1
First indentation level.

See Also:
Constant Field Values

LEVEL2

public static final int LEVEL2
Second indentation level.

See Also:
Constant Field Values

LEVEL3

public static final int LEVEL3
Third indentation level.

See Also:
Constant Field Values

LEVEL4

public static final int LEVEL4
Fourth indentation level.

See Also:
Constant Field Values
Constructor Detail

Formatter

public Formatter()
Method Detail

setSpaces

public void setSpaces(java.lang.String newValue)
Specifies the spaces value.

Parameters:
newValue - String the new spaces value.

getNewLine

public java.lang.String getNewLine()
Get the line separator.

Returns:
String
See Also:
setNewLine(java.lang.String)

setNewLine

public void setNewLine(java.lang.String newValue)
set the line separator.

Parameters:
newValue - String
See Also:
getNewLine()

getIndentLevel

public int getIndentLevel()
Get the current indentation level.

Returns:
int
See Also:
setIndentLevel(int)

setIndentLevel

public void setIndentLevel(int newValue)
Set the indentation level..

Parameters:
newValue - int
See Also:
getIndentLevel()

getIndent

public java.lang.String getIndent(int level)
Get an indent string for the given level.

Parameters:
level - int
Returns:
String

indent

public java.lang.String indent(java.lang.String newLine)
Increment the indentation level and return the indented string, followed by the line separator.

Parameters:
newLine - String
Returns:
String

unIndent

public java.lang.String unIndent(java.lang.String newLine)
Decrement the indentation level and return the indented string, followed by the line separator.

Parameters:
newLine - String
Returns:
String

add

public java.lang.String add(java.lang.String newLine)
Return the indented string, followed by the line separator.

Parameters:
newLine - String
Returns:
String


Copyright (c) 1998-2006 BetaSoft Michael Justin. All Rights Reserved.