Deprecated
As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
is replaced by that of Xalan. Main class
com. is replaced
by com..
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)
References Deprecated
OutputFormat is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | breakLine()
Overrides com. Called to print a line consisting of the text accumulated so far. |
| public void | breakLine(boolean preserveSpace)
Overrides com.
|
| public void | enterDTD()
Overrides com. Called by any of the DTD handlers to enter DTD mode. |
| public void | |
| public void | flushLine(boolean preserveSpace)
Overrides com. Flushes the line accumulated so far to the writer and get ready to accumulate the next line. |
| public int | |
| public void | indent()
Overrides com. Increment the indentation for the next line. |
| public String | leaveDTD()
Overrides com. 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()
Overrides com. Called to print a single space between text parts that may be broken into separate lines. |
| public void | printText(String
The text to print text)Overrides com. Called to print additional text. |
| public void | |
| public void | |
| public void | printText(char[] chars, int start, int length)
Overrides com.
|
| public void | |
| public void | |
| public void | unindent()
Overrides com. Decrement the indentation for the next line. |
| _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)
References Deprecated
See corresponding docs for further information. | |
| breakLine | back to summary |
|---|---|
| public void breakLine() Overrides com. 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 com. | |
| enterDTD | back to summary |
|---|---|
| public void enterDTD() Overrides com. 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 com. 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 com. 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() Overrides com. | |
| indent | back to summary |
|---|---|
| public void indent() Overrides com. Increment the indentation for the next line. | |
| leaveDTD | back to summary |
|---|---|
| public String leaveDTD() Overrides com. 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 com. 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 com. 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 com. | |
| printText | back to summary |
|---|---|
| public void printText(char ch) Overrides com. | |
| printText | back to summary |
|---|---|
| public void printText(char[] chars, int start, int length) Overrides com. | |
| setNextIndent | back to summary |
|---|---|
| public void setNextIndent(int indent) Overrides com. | |
| setThisIndent | back to summary |
|---|---|
| public void setThisIndent(int indent) Overrides com. | |
| unindent | back to summary |
|---|---|
| public void unindent() Overrides com. Decrement the indentation for the next line. | |