org.springframework.util.xml
Class StaxStreamXMLReader

java.lang.Object
  extended by org.springframework.util.xml.AbstractXMLReader
      extended by org.springframework.util.xml.AbstractStaxXMLReader
          extended by 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)

Field Summary
private static java.lang.String DEFAULT_XML_VERSION
           
private  java.lang.String encoding
           
private  javax.xml.stream.XMLStreamReader reader
           
private  java.lang.String xmlVersion
           
 
Constructor Summary
StaxStreamXMLReader(javax.xml.stream.XMLStreamReader reader)
          Constructs a new instance of the StaxStreamXmlReader that reads from the given XMLStreamReader.
 
Method Summary
private  org.xml.sax.Attributes getAttributes()
           
private  void handleCharacters()
           
private  void handleComment()
           
private  void handleDtd()
           
private  void handleEndDocument()
           
private  void handleEndElement()
           
private  void handleEntityReference()
           
private  void handleProcessingInstruction()
           
private  void handleStartDocument()
           
private  void handleStartElement()
           
protected  void parseInternal()
          Template-method that parses the StAX reader passed at construction-time.
 
Methods inherited from class org.springframework.util.xml.AbstractStaxXMLReader
endPrefixMapping, getFeature, hasNamespacePrefixesFeature, hasNamespacesFeature, parse, parse, setFeature, setStandalone, startPrefixMapping, toQualifiedName
 
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
 

Field Detail

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
Constructor Detail

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
Method Detail

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()