class StaxEventXMLReader extends AbstractStaxXMLReader
XMLReader
that reads from a StAX XMLEventReader
. Consumes XMLEvents
from
an XMLEventReader
, and calls the corresponding methods on the SAX callback interfaces.XMLEventReader
,
AbstractXMLReader.setContentHandler(org.xml.sax.ContentHandler)
,
AbstractXMLReader.setDTDHandler(org.xml.sax.DTDHandler)
,
AbstractXMLReader.setEntityResolver(org.xml.sax.EntityResolver)
,
AbstractXMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_XML_VERSION |
private java.lang.String |
encoding |
private javax.xml.stream.XMLEventReader |
reader |
private java.lang.String |
xmlVersion |
Constructor and Description |
---|
StaxEventXMLReader(javax.xml.stream.XMLEventReader reader)
Constructs a new instance of the
StaxEventXmlReader that reads from the given
XMLEventReader . |
Modifier and Type | Method and Description |
---|---|
private org.xml.sax.Attributes |
getAttributes(javax.xml.stream.events.StartElement event) |
private void |
handleCharacters(javax.xml.stream.events.Characters characters) |
private void |
handleComment(javax.xml.stream.events.Comment comment) |
private void |
handleDtd(javax.xml.stream.events.DTD dtd) |
private void |
handleEndDocument() |
private void |
handleEndElement(javax.xml.stream.events.EndElement endElement) |
private void |
handleEntityDeclaration(javax.xml.stream.events.EntityDeclaration entityDeclaration) |
private void |
handleEntityReference(javax.xml.stream.events.EntityReference reference) |
private void |
handleNotationDeclaration(javax.xml.stream.events.NotationDeclaration declaration) |
private void |
handleProcessingInstruction(javax.xml.stream.events.ProcessingInstruction pi) |
private void |
handleStartDocument(javax.xml.stream.events.XMLEvent event) |
private void |
handleStartElement(javax.xml.stream.events.StartElement startElement) |
protected void |
parseInternal()
Template method that parses the StAX reader passed at construction-time.
|
endPrefixMapping, getFeature, hasNamespacePrefixesFeature, hasNamespacesFeature, parse, parse, setFeature, setStandalone, startPrefixMapping, toQualifiedName
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getLexicalHandler, getProperty, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setProperty
private static final java.lang.String DEFAULT_XML_VERSION
private final javax.xml.stream.XMLEventReader reader
private java.lang.String xmlVersion
@Nullable private java.lang.String encoding
StaxEventXMLReader(javax.xml.stream.XMLEventReader reader)
StaxEventXmlReader
that reads from the given
XMLEventReader
. The supplied event reader must be in XMLStreamConstants.START_DOCUMENT
or
XMLStreamConstants.START_ELEMENT
state.reader
- the XMLEventReader
to read fromjava.lang.IllegalStateException
- if the reader is not at the start of a document or elementprotected void parseInternal() throws org.xml.sax.SAXException, javax.xml.stream.XMLStreamException
AbstractStaxXMLReader
parseInternal
in class AbstractStaxXMLReader
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
private void handleStartDocument(javax.xml.stream.events.XMLEvent event) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleStartElement(javax.xml.stream.events.StartElement startElement) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleCharacters(javax.xml.stream.events.Characters characters) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleEndElement(javax.xml.stream.events.EndElement endElement) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleEndDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleNotationDeclaration(javax.xml.stream.events.NotationDeclaration declaration) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleEntityDeclaration(javax.xml.stream.events.EntityDeclaration entityDeclaration) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleProcessingInstruction(javax.xml.stream.events.ProcessingInstruction pi) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleComment(javax.xml.stream.events.Comment comment) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleDtd(javax.xml.stream.events.DTD dtd) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void handleEntityReference(javax.xml.stream.events.EntityReference reference) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private org.xml.sax.Attributes getAttributes(javax.xml.stream.events.StartElement event)