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, endTag
protected final ContentHandler out
public SAXOutput(ContentHandler out)
public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException
XmlOutputAbstractImpl
startDocument
in interface XmlOutput
startDocument
in class XmlOutputAbstractImpl
serializer
- the XMLSerializer
that coordinates this whole marshalling episode.fragment
- true if we are marshalling a fragment.SAXException
IOException
XMLStreamException
public void endDocument(boolean fragment) throws SAXException, IOException, XMLStreamException
XmlOutputAbstractImpl
endDocument
in interface XmlOutput
endDocument
in class XmlOutputAbstractImpl
fragment
- false if we are writing the whole document.SAXException
IOException
XMLStreamException
public void beginStartTag(int prefix, String localName)
beginStartTag
in interface XmlOutput
beginStartTag
in class XmlOutputAbstractImpl
public void attribute(int prefix, String localName, String value)
attribute
in interface XmlOutput
attribute
in class XmlOutputAbstractImpl
prefix
- -1 if this attribute does not have a prefix
(this handling differs from that of elements.)public void endStartTag() throws SAXException
endStartTag
in interface XmlOutput
endStartTag
in class XmlOutputAbstractImpl
SAXException
public void endTag(int prefix, String localName) throws SAXException
endTag
in interface XmlOutput
endTag
in class XmlOutputAbstractImpl
SAXException
public void text(String value, boolean needsSP) throws IOException, SAXException, XMLStreamException
XmlOutput
value
- this string can contain characters that might need escaping
(such as '&' or '>')IOException
SAXException
XMLStreamException
public void text(Pcdata value, boolean needsSP) throws IOException, SAXException, XMLStreamException
XmlOutput
value
- this string can contain characters that might need escaping
(such as '&' or '>')IOException
SAXException
XMLStreamException
Copyright © 2017 JBoss by Red Hat. All rights reserved.