public final class IndentingUTF8XmlOutput extends UTF8XmlOutput
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.closeStartTagPending, octetBuffer, octetBufferIndex, outnsContext, nsUriIndex2prefixIndex, serializer| Constructor and Description |
|---|
IndentingUTF8XmlOutput(OutputStream out,
String indentStr,
Encoded[] localNames,
CharacterEscapeHandler escapeHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginStartTag(int prefix,
String localName) |
void |
beginStartTag(Name name)
Writes a start tag.
|
void |
endDocument(boolean fragment)
Called at the very end.
|
void |
endTag(int prefix,
String localName) |
void |
endTag(Name name) |
void |
text(Pcdata value,
boolean needSP)
Writes XML text with character escaping, if necessary.
|
void |
text(String value,
boolean needSP)
Writes XML text with character escaping, if necessary.
|
attribute, attribute, closeStartTag, endStartTag, flushBuffer, setHeader, startDocument, text, text, write, write, write, writeNsDecl, writeNsDeclspublic IndentingUTF8XmlOutput(OutputStream out, String indentStr, Encoded[] localNames, CharacterEscapeHandler escapeHandler)
indentStr - set to null for no indentation and optimal performance.
otherwise the string is used for indentation.public void beginStartTag(int prefix,
String localName)
throws IOException
beginStartTag in interface XmlOutputbeginStartTag in class UTF8XmlOutputIOExceptionpublic void beginStartTag(Name name) throws IOException
XmlOutputAbstractImpl
At this point XmlOutputAbstractImpl.nsContext holds namespace declarations needed for this
new element.
This method is used for writing tags that are indexed.
beginStartTag in interface XmlOutputbeginStartTag in class UTF8XmlOutputIOExceptionpublic void endTag(Name name) throws IOException
endTag in interface XmlOutputendTag in class UTF8XmlOutputIOExceptionpublic void endTag(int prefix,
String localName)
throws IOException
endTag in interface XmlOutputendTag in class UTF8XmlOutputIOExceptionpublic void text(String value, boolean needSP) throws IOException
XmlOutputtext in interface XmlOutputtext in class UTF8XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')IOExceptionpublic void text(Pcdata value, boolean needSP) throws IOException
XmlOutputtext in interface XmlOutputtext in class UTF8XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')IOExceptionpublic void endDocument(boolean fragment)
throws IOException,
SAXException,
XMLStreamException
XmlOutputAbstractImplendDocument in interface XmlOutputendDocument in class UTF8XmlOutputfragment - false if we are writing the whole document.IOExceptionSAXExceptionXMLStreamExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.