UTF8XmlOutput with indentation.
Todo
not sure if it's a good idea to move the indenting functionality to another class. Doesn't have to be final, but it helps the JVM.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final Encoded | indent8
Null if the writer should perform no indentation. |
| private boolean | |
| private final int | unitLen
Length of one indentation. |
| Access | Constructor and Description |
|---|---|
| public | IndentingUTF8XmlOutput(OutputStream out, String
set to null for no indentation and optimal performance.
otherwise the string is used for indentation. indentStr, Encoded[] localNames, CharacterEscapeHandler escapeHandler)
|
| depth | back to summary |
|---|---|
| private int depth | |
| indent8 | back to summary |
|---|---|
| private final Encoded indent8 Null if the writer should perform no indentation. Otherwise this will keep the 8 copies of the string for indentation. (so that we can write 8 indentation at once.) | |
| seenText | back to summary |
|---|---|
| private boolean seenText | |
| unitLen | back to summary |
|---|---|
| private final int unitLen Length of one indentation. | |
| IndentingUTF8XmlOutput | back to summary |
|---|---|
public IndentingUTF8XmlOutput(OutputStream out, String indentStr, Encoded[] localNames, CharacterEscapeHandler escapeHandler)
| |
| beginStartTag | back to summary |
|---|---|
| public void beginStartTag(int prefix, String localName) throws IOException Overrides org. Implements org.
| |
| beginStartTag | back to summary |
|---|---|
| public void beginStartTag(Name name) throws IOException Overrides org. Implements org. Doc from org. Writes a start tag.
At this point This method is used for writing tags that are indexed.
| |
| endDocument | back to summary |
|---|---|
| public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException Overrides org. Implements org. Doc from org. Called at the very end.
| |
| endTag | back to summary |
|---|---|
| public void endTag(Name name) throws IOException Overrides org. Implements org.
| |
| endTag | back to summary |
|---|---|
| public void endTag(int prefix, String localName) throws IOException Overrides org. Implements org.
| |
| indentEndTag | back to summary |
|---|---|
| private void indentEndTag() throws IOException | |
| indentStartTag | back to summary |
|---|---|
| private void indentStartTag() throws IOException | |
| printIndent | back to summary |
|---|---|
| private void printIndent() throws IOException | |
| text | back to summary |
|---|---|
| public void text(String value, boolean needSP) throws IOException Overrides org. Implements org. Doc from org. Writes XML text with character escaping, if necessary.
| |
| text | back to summary |
|---|---|
| public void text(Pcdata value, boolean needSP) throws IOException Overrides org. Implements org. Doc from org. Writes XML text with character escaping, if necessary.
| |