org.springframework.util.xml
Class StaxStreamXMLReader
java.lang.Object
org.springframework.util.xml.AbstractXMLReader
org.springframework.util.xml.AbstractStaxXMLReader
org.springframework.util.xml.StaxStreamXMLReader
- All Implemented Interfaces:
- org.xml.sax.XMLReader
class StaxStreamXMLReader
- extends AbstractStaxXMLReader
SAX XMLReader
that reads from a StAX XMLStreamReader
. Reads from an
XMLStreamReader
, and calls the corresponding methods on the SAX callback interfaces.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
XMLStreamReader
,
AbstractXMLReader.setContentHandler(org.xml.sax.ContentHandler)
,
AbstractXMLReader.setDTDHandler(org.xml.sax.DTDHandler)
,
AbstractXMLReader.setEntityResolver(org.xml.sax.EntityResolver)
,
AbstractXMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
Constructor Summary |
StaxStreamXMLReader(javax.xml.stream.XMLStreamReader reader)
Constructs a new instance of the StaxStreamXmlReader that reads from the given
XMLStreamReader . |
Methods inherited from class org.springframework.util.xml.AbstractXMLReader |
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getLexicalHandler, getProperty, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_XML_VERSION
private static final java.lang.String DEFAULT_XML_VERSION
- See Also:
- Constant Field Values
reader
private final javax.xml.stream.XMLStreamReader reader
xmlVersion
private java.lang.String xmlVersion
encoding
private java.lang.String encoding
StaxStreamXMLReader
StaxStreamXMLReader(javax.xml.stream.XMLStreamReader reader)
- Constructs a new instance of the
StaxStreamXmlReader
that reads from the given
XMLStreamReader
. The supplied stream reader must be in XMLStreamConstants.START_DOCUMENT
or XMLStreamConstants.START_ELEMENT
state.
- Parameters:
reader
- the XMLEventReader
to read from
- Throws:
java.lang.IllegalStateException
- if the reader is not at the start of a document or element
parseInternal
protected void parseInternal()
throws org.xml.sax.SAXException,
javax.xml.stream.XMLStreamException
- Description copied from class:
AbstractStaxXMLReader
- Template-method that parses the StAX reader passed at construction-time.
- Specified by:
parseInternal
in class AbstractStaxXMLReader
- Throws:
org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
handleStartDocument
private void handleStartDocument()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleStartElement
private void handleStartElement()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleEndElement
private void handleEndElement()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleCharacters
private void handleCharacters()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleComment
private void handleComment()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleDtd
private void handleDtd()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleEntityReference
private void handleEntityReference()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleEndDocument
private void handleEndDocument()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
handleProcessingInstruction
private void handleProcessingInstruction()
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
getAttributes
private org.xml.sax.Attributes getAttributes()