Top Description Fields Constructors Methods
org.springframework.util.xml

pack-priv Class StaxEventXMLReader

extends AbstractStaxXMLReader
Class Inheritance
Annotations
@SuppressWarnings:rawtypes
Imports
java.util.Iterator, javax.xml.namespace.QName, javax.xml.stream.Location, .XMLEventReader, .XMLStreamConstants, .XMLStreamException, javax.xml.stream.events.Attribute, .Characters, .Comment, .DTD, .EndElement, .EntityDeclaration, .EntityReference, .Namespace, .NotationDeclaration, .ProcessingInstruction, .StartDocument, .StartElement, .XMLEvent, org.xml.sax.Attributes, .ContentHandler, .SAXException, org.xml.sax.ext.Locator2, org.xml.sax.helpers.AttributesImpl, org.springframework.lang.Nullable, org.springframework.util.StringUtils

SAX XMLReader that reads from a StAX XMLEventReader. Consumes XMLEvents from an XMLEventReader, and calls the corresponding methods on the SAX callback interfaces.
Author
Arjen Poutsma
Since
3.0
See Also
XMLEventReader, setContentHandler(org.xml.sax.ContentHandler), setDTDHandler(org.xml.sax.DTDHandler), setEntityResolver(org.xml.sax.EntityResolver), setErrorHandler(org.xml.sax.ErrorHandler)

Field Summary

Modifier and TypeField and Description
private static final String
private String
private final XMLEventReader
private String

Constructor Summary

AccessConstructor and Description
pack-priv
StaxEventXMLReader(XMLEventReader
the XMLEventReader to read from
reader
)

Constructs a new instance of the StaxEventXmlReader that reads from the given XMLEventReader.

Method Summary

Modifier and TypeMethod and Description
private Attributes
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
protected void
parseInternal()

Implements abstract org.springframework.util.xml.AbstractStaxXMLReader.parseInternal.

Template method that parses the StAX reader passed at construction-time.

Inherited from org.springframework.util.xml.AbstractStaxXMLReader:
endPrefixMappinggetFeaturehasNamespacePrefixesFeaturehasNamespacesFeatureparseparsesetFeaturesetStandalonestartPrefixMappingtoQualifiedName

Field Detail

DEFAULT_XML_VERSIONback to summary
private static final String DEFAULT_XML_VERSION
encodingback to summary
private String encoding
Annotations
@Nullable
readerback to summary
private final XMLEventReader reader
xmlVersionback to summary
private String xmlVersion

Constructor Detail

StaxEventXMLReaderback to summary
pack-priv StaxEventXMLReader(XMLEventReader reader)

Constructs a new instance of the StaxEventXmlReader that reads from the given XMLEventReader. The supplied event reader must be in XMLStreamConstants.START_DOCUMENT or XMLStreamConstants.START_ELEMENT state.

Parameters
reader:XMLEventReader

the XMLEventReader to read from

Exceptions
IllegalStateException:
if the reader is not at the start of a document or element

Method Detail

getAttributesback to summary
private Attributes getAttributes(StartElement event)
handleCharactersback to summary
private void handleCharacters(Characters characters) throws SAXException
handleCommentback to summary
private void handleComment(Comment comment) throws SAXException
handleDtdback to summary
private void handleDtd(DTD dtd) throws SAXException
handleEndDocumentback to summary
private void handleEndDocument() throws SAXException
handleEndElementback to summary
private void handleEndElement(EndElement endElement) throws SAXException
handleEntityDeclarationback to summary
private void handleEntityDeclaration(EntityDeclaration entityDeclaration) throws SAXException
handleEntityReferenceback to summary
private void handleEntityReference(EntityReference reference) throws SAXException
handleNotationDeclarationback to summary
private void handleNotationDeclaration(NotationDeclaration declaration) throws SAXException
handleProcessingInstructionback to summary
private void handleProcessingInstruction(ProcessingInstruction pi) throws SAXException
handleStartDocumentback to summary
private void handleStartDocument(final XMLEvent event) throws SAXException
handleStartElementback to summary
private void handleStartElement(StartElement startElement) throws SAXException
parseInternalback to summary
protected void parseInternal() throws SAXException, XMLStreamException

Implements abstract org.springframework.util.xml.AbstractStaxXMLReader.parseInternal.

Doc from org.springframework.util.xml.AbstractStaxXMLReader.parseInternal.

Template method that parses the StAX reader passed at construction-time.

Annotations
@Override