| java.lang.Object org.jasig.portal.serialize.Printer org.jasig.portal.serialize.IndentPrinter
IndentPrinter | public class IndentPrinter extends Printer (Code) | | Extends
Printer and adds support for indentation and line
wrapping.
version: $Revision: 36559 $ $Date: 2006-04-28 11:38:13 -0700 (Fri, 28 Apr 2006) $ author: Assaf Arkin |
Method Summary | |
public void | breakLine() Called to print a line consisting of the text accumulated so
far. | public void | breakLine(boolean preserveSpace) | public void | enterDTD() Called by any of the DTD handlers to enter DTD mode.
Once entered, all output will be accumulated in a string
that can be printed as part of the document's DTD.
This method may be called any number of time but will only
have affect the first time it's called. | public void | flush() Flush the output stream. | public void | flushLine(boolean preserveSpace) Flushes the line accumulated so far to the writer and get ready
to accumulate the next line. | public int | getNextIndent() | public void | indent() Increment the indentation for the next line. | public String | leaveDTD() Called by the root element to leave DTD mode and if any
DTD parts were printer, will return a string with their
textual content. | public void | printSpace() Called to print a single space between text parts that may be
broken into separate lines. | public void | printText(String text) Called to print additional text. | public void | printText(StringBuffer text) | public void | printText(char ch) | public void | printText(char[] chars, int start, int length) | public void | setNextIndent(int indent) | public void | setThisIndent(int indent) | public void | unindent() Decrement the indentation for the next line. |
breakLine | public void breakLine()(Code) | | Called to print a line consisting of the text accumulated so
far. This is equivalent to calling
IndentPrinter.printSpace but
forcing the line to print and starting a new line (
IndentPrinter.printSpace will only start a new line if the current line
is long enough).
|
breakLine | public void breakLine(boolean preserveSpace)(Code) | | |
enterDTD | public void enterDTD()(Code) | | Called by any of the DTD handlers to enter DTD mode.
Once entered, all output will be accumulated in a string
that can be printed as part of the document's DTD.
This method may be called any number of time but will only
have affect the first time it's called. To exist DTD state
and get the accumulated DTD, call
IndentPrinter.leaveDTD .
|
flush | public void flush()(Code) | | Flush the output stream. Must be called when done printing
the document, otherwise some text might be buffered.
|
flushLine | public void flushLine(boolean preserveSpace)(Code) | | Flushes the line accumulated so far to the writer and get ready
to accumulate the next line. This method is called by
IndentPrinter.printText and
IndentPrinter.printSpace when the accumulated line plus
accumulated text are two long to fit on a given line. At the end of
this method _line is empty and _spaces is zero.
|
getNextIndent | public int getNextIndent()(Code) | | |
indent | public void indent()(Code) | | Increment the indentation for the next line.
|
leaveDTD | public String leaveDTD()(Code) | | Called by the root element to leave DTD mode and if any
DTD parts were printer, will return a string with their
textual content.
|
printSpace | public void printSpace()(Code) | | Called to print a single space between text parts that may be
broken into separate lines. Must not be called to print a space
when preserving spaces. The text accumulated so far with
IndentPrinter.printText will be added to the accumulated line, and a space
separator will be counted. If the line accumulated so far is
long enough, it will be printed.
|
printText | public void printText(String text)(Code) | | Called to print additional text. Each time this method is called
it accumulates more text. When a space is printed (
IndentPrinter.printSpace ) all the accumulated text becomes one part and is
added to the accumulate line. When a line is long enough, it can
be broken at its text boundary.
Parameters: text - The text to print |
printText | public void printText(char ch)(Code) | | |
printText | public void printText(char[] chars, int start, int length)(Code) | | |
setNextIndent | public void setNextIndent(int indent)(Code) | | |
setThisIndent | public void setThisIndent(int indent)(Code) | | |
unindent | public void unindent()(Code) | | Decrement the indentation for the next line.
|
|
|