public class SAXOutput extends XmlOutputAbstractImpl
XmlOutput implementation that writes to SAX ContentHandler.| Modifier and Type | Field and Description |
|---|---|
protected ContentHandler |
out |
nsContext, nsUriIndex2prefixIndex, serializer| Constructor and Description |
|---|
SAXOutput(ContentHandler out) |
| Modifier and Type | Method and Description |
|---|---|
void |
attribute(int prefix,
String localName,
String value) |
void |
beginStartTag(int prefix,
String localName) |
void |
endDocument(boolean fragment)
Called at the very end.
|
void |
endStartTag() |
void |
endTag(int prefix,
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(String value,
boolean needsSP)
Writes XML text with character escaping, if necessary.
|
attribute, beginStartTag, endTagprotected final ContentHandler out
public SAXOutput(ContentHandler out)
public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException
XmlOutputAbstractImplstartDocument in interface XmlOutputstartDocument in class XmlOutputAbstractImplserializer - the XMLSerializer that coordinates this whole marshalling episode.fragment - true if we are marshalling a fragment.SAXExceptionIOExceptionXMLStreamExceptionpublic void endDocument(boolean fragment)
throws SAXException,
IOException,
XMLStreamException
XmlOutputAbstractImplendDocument in interface XmlOutputendDocument in class XmlOutputAbstractImplfragment - false if we are writing the whole document.SAXExceptionIOExceptionXMLStreamExceptionpublic void beginStartTag(int prefix,
String localName)
beginStartTag in interface XmlOutputbeginStartTag in class XmlOutputAbstractImplpublic void attribute(int prefix,
String localName,
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 SAXException
endStartTag in interface XmlOutputendStartTag in class XmlOutputAbstractImplSAXExceptionpublic void endTag(int prefix,
String localName)
throws SAXException
endTag in interface XmlOutputendTag in class XmlOutputAbstractImplSAXExceptionpublic void text(String value, boolean needsSP) throws IOException, SAXException, XMLStreamException
XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')IOExceptionSAXExceptionXMLStreamExceptionpublic void text(Pcdata value, boolean needsSP) throws IOException, SAXException, XMLStreamException
XmlOutputvalue - this string can contain characters that might need escaping
(such as '&' or '>')IOExceptionSAXExceptionXMLStreamExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.