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(XMLEventConsumer consumer)
Constructs an instance that writes events to the provided
XMLEventConsumer.
|
StAXEventContentHandler(XMLEventConsumer consumer,
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 Namespace |
createNamespace(java.lang.String prefix,
java.lang.String uri) |
protected void |
createStartEvents(Attributes attributes,
java.util.Collection[] events)
|
void |
endCDATA() |
void |
endDocument() |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
XMLEventConsumer |
getEventConsumer()
Returns a reference to the
XMLEventConsumer to which events will
be written. |
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(XMLEventConsumer consumer)
Sets the
XMLEventConsumer to which events are written. |
void |
setEventFactory(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,
Attributes attributes) |
endDTD, endEntity, endPrefixMapping, error, fatalError, getCurrentLocation, parseQName, reportException, setDocumentLocator, setXMLReporter, startCDATA, startDTD, startEntity, startPrefixMapping, warning
notationDecl, resolveEntity, skippedEntity, unparsedEntityDecl
public StAXEventContentHandler()
XMLEventConsumer
via the
setEventConsumer(XMLEventConsumer)
method.public StAXEventContentHandler(XMLEventConsumer consumer)
consumer
- The XMLEventConsumer
to which events will be
written.public StAXEventContentHandler(XMLEventConsumer consumer, 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 XMLEventConsumer getEventConsumer()
XMLEventConsumer
to which events will
be written.XMLEventConsumer
to which events will be written.public void setEventConsumer(XMLEventConsumer consumer)
XMLEventConsumer
to which events are written.consumer
- The XMLEventConsumer
to which events will be
written.public XMLEventFactory getEventFactory()
XMLEventFactory
used to construct
events.XMLEventFactory
used to construct events.public void setEventFactory(XMLEventFactory factory)
XMLEventFactory
used to create events.factory
- The XMLEventFactory
used to create events.public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class StAXContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class StAXContentHandler
SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class StAXContentHandler
SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class StAXContentHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
comment
in class StAXContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class StAXContentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
endCDATA
in class StAXContentHandler
SAXException
protected void createStartEvents(Attributes attributes, java.util.Collection[] events)
protected Namespace createNamespace(java.lang.String prefix, java.lang.String uri)