public class SAXOutput extends XmlOutputAbstractImpl
XmlOutput implementation that writes to SAX ContentHandler.| Modifier and Type | Field and Description |
|---|---|
protected org.xml.sax.ContentHandler |
out |
nsContext, nsUriIndex2prefixIndex, serializer| Constructor and Description |
|---|
SAXOutput(org.xml.sax.ContentHandler out) |
| Modifier and Type | Method and Description |
|---|---|
void |
attribute(int prefix,
java.lang.String localName,
java.lang.String value) |
void |
beginStartTag(int prefix,
java.lang.String localName) |
void |
endDocument(boolean fragment)
Called at the very end.
|
void |
endStartTag() |
void |
endTag(int prefix,
java.lang.String localName) |
void |
startDocument(XMLSerializer serializer,
boolean fragment,
int[] nsUriIndex2prefixIndex,
NamespaceContextImpl nsContext)
Called at the very beginning.
|
void |
text(Pcdata value,
boolean needsSP)
Writes XML text with character escaping, if necessary.
|
void |
text(java.lang.String value,
boolean needsSP)
Writes XML text with character escaping, if necessary.
|
attribute, beginStartTag, endTagpublic void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.stream.XMLStreamException
XmlOutputAbstractImplstartDocument in interface XmlOutputstartDocument in class XmlOutputAbstractImplserializer - the XMLSerializer that coordinates this whole marshalling episode.fragment - true if we are marshalling a fragment.org.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void endDocument(boolean fragment)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.stream.XMLStreamException
XmlOutputAbstractImplendDocument in interface XmlOutputendDocument in class XmlOutputAbstractImplfragment - false if we are writing the whole document.org.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void beginStartTag(int prefix,
java.lang.String localName)
beginStartTag in interface XmlOutputbeginStartTag in class XmlOutputAbstractImplpublic void attribute(int prefix,
java.lang.String localName,
java.lang.String value)
attribute in interface XmlOutputattribute in class XmlOutputAbstractImplprefix - -1 if this attribute does not have a prefix
(this handling differs from that of elements.)public void endStartTag()
throws org.xml.sax.SAXException
endStartTag in interface XmlOutputendStartTag in class XmlOutputAbstractImplorg.xml.sax.SAXExceptionpublic void endTag(int prefix,
java.lang.String localName)
throws org.xml.sax.SAXException
endTag in interface XmlOutputendTag in class XmlOutputAbstractImplorg.xml.sax.SAXExceptionpublic void text(java.lang.String value,
boolean needsSP)
throws java.io.IOException,
org.xml.sax.SAXException,
javax.xml.stream.XMLStreamException
XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')java.io.IOExceptionorg.xml.sax.SAXExceptionjavax.xml.stream.XMLStreamExceptionpublic void text(Pcdata value, boolean needsSP) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.stream.XMLStreamException
XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')java.io.IOExceptionorg.xml.sax.SAXExceptionjavax.xml.stream.XMLStreamException