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..
IndentPrinter supports indentation and line wrapping by
extending this class.
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | _buffer
Output buffer. |
| protected Writer | _docWriter
Holds a reference to the document writer while we are in DTD mode. |
| protected StringWriter | _dtdWriter
The DTD writer. |
| protected IOException | _exception
Holds the exception thrown by the serializer. |
| protected final OutputFormat | _format
References Deprecated
The output format associated with this serializer.
OutputFormat is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private int | _pos
Position within the output buffer. |
| protected Writer | _writer
The writer to which the document is written. |
| private static final int | BufferSize
The size of the output buffer. |
| Access | Constructor and Description |
|---|---|
| public | Printer(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 | |
| public void | |
| public void | |
| public void | |
| public void | |
| public IOException | |
| public int | |
| public void | |
| 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 | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| _buffer | back to summary |
|---|---|
| private final char[] _buffer Output buffer. | |
| _docWriter | back to summary |
|---|---|
| protected Writer _docWriter Holds a reference to the document writer while we are in DTD mode. | |
| _dtdWriter | back to summary |
|---|---|
| protected StringWriter _dtdWriter The DTD writer. When we switch to DTD mode, all output is accumulated in this DTD writer. When we switch out of it, the output is obtained as a string. Must not be reset to null until we're done with the document. | |
| _exception | back to summary |
|---|---|
| protected IOException _exception Holds the exception thrown by the serializer. Exceptions do not cause the serializer to quit, but are held and one is thrown at the end. | |
| _format | back to summary |
|---|---|
| protected final OutputFormat _format
References Deprecated
See corresponding docs for further information. The output format associated with this serializer. This will never be a null reference. If no format was passed to the constructor, the default one for this document type will be used. The format object is never changed by the serializer. | |
| _pos | back to summary |
|---|---|
| private int _pos Position within the output buffer. | |
| _writer | back to summary |
|---|---|
| protected Writer _writer The writer to which the document is written. | |
| BufferSize | back to summary |
|---|---|
| private static final int BufferSize The size of the output buffer. | |
| Printer | back to summary |
|---|---|
| public Printer(Writer writer, OutputFormat format)
References Deprecated
See corresponding docs for further information. | |
| breakLine | back to summary |
|---|---|
| public void breakLine() throws IOException | |
| breakLine | back to summary |
|---|---|
| public void breakLine(boolean preserveSpace) throws IOException | |
| enterDTD | back to summary |
|---|---|
| public void enterDTD() throws IOException 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() throws IOException 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) throws IOException | |
| getException | back to summary |
|---|---|
| public IOException getException() | |
| getNextIndent | back to summary |
|---|---|
| public int getNextIndent() | |
| indent | back to summary |
|---|---|
| public void indent() | |
| leaveDTD | back to summary |
|---|---|
| public String leaveDTD() throws IOException 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() throws IOException | |
| printText | back to summary |
|---|---|
| public void printText(String text) throws IOException | |
| printText | back to summary |
|---|---|
| public void printText(StringBuffer text) throws IOException | |
| printText | back to summary |
|---|---|
| public void printText(char[] chars, int start, int length) throws IOException | |
| printText | back to summary |
|---|---|
| public void printText(char ch) throws IOException | |
| 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() | |