Module com.sun.xml.bind
Class IndentingUTF8XmlOutput
- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutputAbstractImpl
-
- org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput
-
- org.glassfish.jaxb.runtime.v2.runtime.output.IndentingUTF8XmlOutput
-
- All Implemented Interfaces:
XmlOutput
public final class IndentingUTF8XmlOutput extends UTF8XmlOutput
UTF8XmlOutputwith 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.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput
closeStartTagPending, octetBuffer, octetBufferIndex, out
-
Fields inherited from class org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutputAbstractImpl
nsContext, nsUriIndex2prefixIndex, serializer
-
-
Constructor Summary
Constructors Constructor Description IndentingUTF8XmlOutput(OutputStream out, String indentStr, Encoded[] localNames, CharacterEscapeHandler escapeHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginStartTag(int prefix, String localName)voidbeginStartTag(Name name)Writes a start tag.voidendDocument(boolean fragment)Called at the very end.voidendTag(int prefix, String localName)voidendTag(Name name)voidtext(String value, boolean needSP)Writes XML text with character escaping, if necessary.voidtext(Pcdata value, boolean needSP)Writes XML text with character escaping, if necessary.-
Methods inherited from class org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput
attribute, attribute, closeStartTag, endStartTag, flushBuffer, setHeader, startDocument, text, text, write, write, write, writeNsDecl, writeNsDecls
-
-
-
-
Constructor Detail
-
IndentingUTF8XmlOutput
public IndentingUTF8XmlOutput(OutputStream out, String indentStr, Encoded[] localNames, CharacterEscapeHandler escapeHandler)
- Parameters:
indentStr- set to null for no indentation and optimal performance. otherwise the string is used for indentation.
-
-
Method Detail
-
beginStartTag
public void beginStartTag(int prefix, String localName) throws IOException- Specified by:
beginStartTagin interfaceXmlOutput- Overrides:
beginStartTagin classUTF8XmlOutput- Throws:
IOException
-
beginStartTag
public void beginStartTag(Name name) throws IOException
Description copied from class:XmlOutputAbstractImplWrites a start tag.At this point
XmlOutputAbstractImpl.nsContextholds namespace declarations needed for this new element.This method is used for writing tags that are indexed.
- Specified by:
beginStartTagin interfaceXmlOutput- Overrides:
beginStartTagin classUTF8XmlOutput- Throws:
IOException
-
endTag
public void endTag(Name name) throws IOException
- Specified by:
endTagin interfaceXmlOutput- Overrides:
endTagin classUTF8XmlOutput- Throws:
IOException
-
endTag
public void endTag(int prefix, String localName) throws IOException- Specified by:
endTagin interfaceXmlOutput- Overrides:
endTagin classUTF8XmlOutput- Throws:
IOException
-
text
public void text(String value, boolean needSP) throws IOException
Description copied from interface:XmlOutputWrites XML text with character escaping, if necessary.- Specified by:
textin interfaceXmlOutput- Overrides:
textin classUTF8XmlOutput- Parameters:
value- this string can contain characters that might need escaping (such as'&' or '>')- Throws:
IOException
-
text
public void text(Pcdata value, boolean needSP) throws IOException
Description copied from interface:XmlOutputWrites XML text with character escaping, if necessary.- Specified by:
textin interfaceXmlOutput- Overrides:
textin classUTF8XmlOutput- Parameters:
value- this string can contain characters that might need escaping (such as'&' or '>')- Throws:
IOException
-
endDocument
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamExceptionDescription copied from class:XmlOutputAbstractImplCalled at the very end.- Specified by:
endDocumentin interfaceXmlOutput- Overrides:
endDocumentin classUTF8XmlOutput- Parameters:
fragment- false if we are writing the whole document.- Throws:
IOExceptionSAXExceptionXMLStreamException
-
-