Deprecated
This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML. See the Xerces documentation for more information.
Printer and adds support for indentation and line
wrapping.
| Modifier and Type | Field and Description |
|---|---|
| private StringBuffer | _line
Holds the currently accumulating text line. |
| private int | _nextIndent
Holds the indentation for the next line to be printed. |
| private int | _spaces
Counts how many white spaces come between the accumulated line and the current accumulated text. |
| private StringBuffer | |
| private int | _thisIndent
Holds the indentation for the current line that is now accumulating in memory and will be sent for printing shortly. |
| Access | Constructor and Description |
|---|---|
| public | IndentPrinter(Writer writer, OutputFormat format)
Deprecated
as a consequence of
OutputFormat being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | breakLine()
Overrides org. |
| public void | |
| public void | enterDTD()
Overrides org. |
| public void | |
| public void | flushLine(boolean preserveSpace)
Overrides org. |
| public int | |
| public void | indent()
Overrides org. |
| public String | leaveDTD()
Overrides org. |
| public void | printSpace()
Overrides org. |
| public void | printText(String
The text to print text)Overrides org. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | unindent()
Overrides org. |
| _line | back to summary |
|---|---|
| private StringBuffer _line Holds the currently accumulating text line. This buffer will constantly be reused by deleting its contents instead of reallocating it. | |
| _nextIndent | back to summary |
|---|---|
| private int _nextIndent Holds the indentation for the next line to be printed. After this line is
printed, | |
| _spaces | back to summary |
|---|---|
| private int _spaces Counts how many white spaces come between the accumulated line and the current accumulated text. Multiple spaces at the end of the a line will not be printed. | |
| _text | back to summary |
|---|---|
| private StringBuffer _text Holds the currently accumulating text that follows | |
| _thisIndent | back to summary |
|---|---|
| private int _thisIndent Holds the indentation for the current line that is now accumulating in memory and will be sent for printing shortly. | |
| IndentPrinter | back to summary |
|---|---|
| public IndentPrinter(Writer writer, OutputFormat format)
Deprecated as a consequence of | |
| breakLine | back to summary |
|---|---|
| public void breakLine() Overrides org. Called to print a line consisting of the text accumulated so
far. This is equivalent to calling | |
| breakLine | back to summary |
|---|---|
| public void breakLine(boolean preserveSpace) Overrides org. | |
| enterDTD | back to summary |
|---|---|
| public void enterDTD() Overrides org. 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 | |
| flush | back to summary |
|---|---|
| public void flush() Overrides org. Flush the output stream. Must be called when done printing the document, otherwise some text might be buffered. | |
| flushLine | back to summary |
|---|---|
| public void flushLine(boolean preserveSpace) Overrides org. Flushes the line accumulated so far to the writer and get ready
to accumulate the next line. This method is called by | |
| getNextIndent | back to summary |
|---|---|
| public int getNextIndent() | |
| indent | back to summary |
|---|---|
| public void indent() Overrides org. Increment the indentation for the next line. | |
| leaveDTD | back to summary |
|---|---|
| public String leaveDTD() Overrides org. 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 | back to summary |
|---|---|
| public void printSpace() Overrides org. 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 | |
| printText | back to summary |
|---|---|
| public void printText(String text) Overrides org. Called to print additional text. Each time this method is called
it accumulates more text. When a space is printed (
| |
| printText | back to summary |
|---|---|
| public void printText(StringBuffer text) Overrides org. | |
| printText | back to summary |
|---|---|
| public void printText(char ch) Overrides org. | |
| printText | back to summary |
|---|---|
| public void printText(char[] chars, int start, int length) Overrides org. | |
| setNextIndent | back to summary |
|---|---|
| public void setNextIndent(int indent) | |
| setThisIndent | back to summary |
|---|---|
| public void setThisIndent(int indent) | |
| unindent | back to summary |
|---|---|
| public void unindent() Overrides org. Decrement the indentation for the next line. | |