class StaxEventContentHandler extends AbstractStaxContentHandler
ContentHandler
that transforms callback calls to XMLEvent
s
and writes them to a XMLEventConsumer
.Modifier and Type | Class and Description |
---|---|
private static class |
StaxEventContentHandler.LocatorLocationAdapter |
Modifier and Type | Field and Description |
---|---|
private javax.xml.stream.util.XMLEventConsumer |
eventConsumer |
private javax.xml.stream.XMLEventFactory |
eventFactory |
Constructor and Description |
---|
StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
Construct a new instance of the
StaxEventContentHandler that writes to the given
XMLEventConsumer . |
StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer,
javax.xml.stream.XMLEventFactory factory)
Construct a new instance of the
StaxEventContentHandler that uses the given
event factory to create events and writes to the given XMLEventConsumer . |
Modifier and Type | Method and Description |
---|---|
protected void |
charactersInternal(char[] ch,
int start,
int length) |
private void |
consumeEvent(javax.xml.stream.events.XMLEvent event) |
private java.util.List<javax.xml.stream.events.Namespace> |
createNamespaces(SimpleNamespaceContext namespaceContext)
Create and return a list of
NameSpace objects from the NamespaceContext . |
protected void |
endDocumentInternal() |
protected void |
endElementInternal(javax.xml.namespace.QName name,
SimpleNamespaceContext namespaceContext) |
private java.util.List<javax.xml.stream.events.Attribute> |
getAttributes(org.xml.sax.Attributes attributes) |
protected void |
ignorableWhitespaceInternal(char[] ch,
int start,
int length) |
protected void |
processingInstructionInternal(java.lang.String target,
java.lang.String data) |
void |
setDocumentLocator(org.xml.sax.Locator locator) |
protected void |
skippedEntityInternal(java.lang.String name) |
protected void |
startDocumentInternal() |
protected void |
startElementInternal(javax.xml.namespace.QName name,
org.xml.sax.Attributes atts,
SimpleNamespaceContext namespaceContext) |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping, toQName
private final javax.xml.stream.XMLEventFactory eventFactory
private final javax.xml.stream.util.XMLEventConsumer eventConsumer
StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
StaxEventContentHandler
that writes to the given
XMLEventConsumer
. A default XMLEventFactory
will be created.consumer
- the consumer to write events toStaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer, javax.xml.stream.XMLEventFactory factory)
StaxEventContentHandler
that uses the given
event factory to create events and writes to the given XMLEventConsumer
.consumer
- the consumer to write events tofactory
- the factory used to create eventspublic void setDocumentLocator(org.xml.sax.Locator locator)
protected void startDocumentInternal() throws javax.xml.stream.XMLStreamException
startDocumentInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void endDocumentInternal() throws javax.xml.stream.XMLStreamException
endDocumentInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void startElementInternal(javax.xml.namespace.QName name, org.xml.sax.Attributes atts, SimpleNamespaceContext namespaceContext) throws javax.xml.stream.XMLStreamException
startElementInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void endElementInternal(javax.xml.namespace.QName name, SimpleNamespaceContext namespaceContext) throws javax.xml.stream.XMLStreamException
endElementInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void charactersInternal(char[] ch, int start, int length) throws javax.xml.stream.XMLStreamException
charactersInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void ignorableWhitespaceInternal(char[] ch, int start, int length) throws javax.xml.stream.XMLStreamException
ignorableWhitespaceInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
protected void processingInstructionInternal(java.lang.String target, java.lang.String data) throws javax.xml.stream.XMLStreamException
processingInstructionInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException
private void consumeEvent(javax.xml.stream.events.XMLEvent event) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private java.util.List<javax.xml.stream.events.Namespace> createNamespaces(SimpleNamespaceContext namespaceContext)
NameSpace
objects from the NamespaceContext
.private java.util.List<javax.xml.stream.events.Attribute> getAttributes(org.xml.sax.Attributes attributes)
protected void skippedEntityInternal(java.lang.String name) throws javax.xml.stream.XMLStreamException
skippedEntityInternal
in class AbstractStaxContentHandler
javax.xml.stream.XMLStreamException