public class StAXEventContentHandler extends StAXContentHandler
XMLEventConsumer
.CDATABuffer, docLocator, isCDATA, namespaces, reporter
Constructor and Description |
---|
StAXEventContentHandler()
Constructs a default instance with a default event factory.
|
StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
Constructs an instance that writes events to the provided
XMLEventConsumer.
|
StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer,
javax.xml.stream.XMLEventFactory factory)
Constructs an instance that writes events constructed with the provided
XMLEventFactory to the provided XMLEventConsumer
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
protected javax.xml.stream.events.Namespace |
createNamespace(java.lang.String prefix,
java.lang.String uri) |
protected void |
createStartEvents(org.xml.sax.Attributes attributes,
java.util.Collection[] events)
Creates the
Namespace and Attribute events associated
with a StartElement . |
void |
endCDATA() |
void |
endDocument() |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
javax.xml.stream.util.XMLEventConsumer |
getEventConsumer()
Returns a reference to the
XMLEventConsumer to which events will
be written. |
javax.xml.stream.XMLEventFactory |
getEventFactory()
Returns a reference to the
XMLEventFactory used to construct
events. |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
void |
setEventConsumer(javax.xml.stream.util.XMLEventConsumer consumer)
Sets the
XMLEventConsumer to which events are written. |
void |
setEventFactory(javax.xml.stream.XMLEventFactory factory)
Sets the
XMLEventFactory used to create events. |
void |
startDocument() |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes) |
endDTD, endEntity, endPrefixMapping, error, fatalError, getCurrentLocation, parseQName, reportException, setDocumentLocator, setXMLReporter, startCDATA, startDTD, startEntity, startPrefixMapping, warning
public StAXEventContentHandler()
XMLEventConsumer
via the
setEventConsumer(XMLEventConsumer)
method.public StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
consumer
- The XMLEventConsumer
to which events will be
written.public StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer, javax.xml.stream.XMLEventFactory factory)
consumer
- The XMLEventConsumer
to which events will be
written.factory
- The XMLEventFactory
used to construct events. If
null
, a default instance will be constructed.public javax.xml.stream.util.XMLEventConsumer getEventConsumer()
XMLEventConsumer
to which events will
be written.XMLEventConsumer
to which events will be written.public void setEventConsumer(javax.xml.stream.util.XMLEventConsumer consumer)
XMLEventConsumer
to which events are written.consumer
- The XMLEventConsumer
to which events will be
written.public javax.xml.stream.XMLEventFactory getEventFactory()
XMLEventFactory
used to construct
events.XMLEventFactory
used to construct events.public void setEventFactory(javax.xml.stream.XMLEventFactory factory)
XMLEventFactory
used to create events.factory
- The XMLEventFactory
used to create events.public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class StAXContentHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class StAXContentHandler
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class StAXContentHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class StAXContentHandler
org.xml.sax.SAXException
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
comment
in class StAXContentHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class StAXContentHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
endCDATA
in class StAXContentHandler
org.xml.sax.SAXException
protected void createStartEvents(org.xml.sax.Attributes attributes, java.util.Collection[] events)
Namespace
and Attribute
events associated
with a StartElement
.attributes
- The SAX attributes object.events
- An array used to return the two collections of
Namespace
and Attribute
events. The
namespaces will be placed at events[0]
and the
attributes as events[1]
.protected javax.xml.stream.events.Namespace createNamespace(java.lang.String prefix, java.lang.String uri)