Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller

pack-priv Class StAXStreamConnector

extends StAXConnector
Class Inheritance
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXExConnector
Imports
org.glassfish.jaxb.core.WhiteSpaceProcessor, org.xml.sax.Attributes, .SAXException, javax.xml.stream.Location, .XMLStreamConstants, .XMLStreamException, .XMLStreamReader, java.lang.reflect.Constructor

Reads XML from StAX XMLStreamReader and feeds events to XmlVisitor.

Todo

Finding the optimized FI implementations is a bit hacky and not very extensible. Can we use the service provider mechanism in general for concrete implementations of StAXConnector.

Authors
[email protected], Kohsuke Kawaguchi
Version
JAXB 2.0

Field Summary

Modifier and TypeField and Description
private final Attributes
attributes

Proxy of Attributes that read from XMLStreamReader.

protected final StringBuilder
buffer

SAX may fire consecutive characters event, but we don't allow it.

private static final Constructor<? extends StAXConnector>
private static final Class<T>
FI_STAX_READER_CLASS

Reference to FI's StAXReader class, if FI can be loaded.

private static final Constructor<? extends StAXConnector>
private static final Class<T>
private final XMLStreamReader
protected boolean
textReported

Set to true if the text() event is reported, and therefore the following text() event should be suppressed.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector:
contextpredictortagNamevisitor

Constructor Summary

AccessConstructor and Description
protected
StAXStreamConnector(XMLStreamReader staxStreamReader, XmlVisitor visitor)

Method Summary

Modifier and TypeMethod and Description
public void
private static boolean
public static StAXConnector
private static boolean
protected Location
protected String
protected void
private void
private void
private static Constructor<? extends StAXConnector>
private static Class<T>
private static Constructor<? extends StAXConnector>
private static Class<T>
private void
processText(boolean ignorable)

Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector:
fixNullgetQNamehandleEndDocumenthandleStartDocument

Field Detail

attributesback to summary
private final Attributes attributes

Proxy of Attributes that read from XMLStreamReader.

bufferback to summary
protected final StringBuilder buffer

SAX may fire consecutive characters event, but we don't allow it. so use this buffer to perform buffering.

FI_CONNECTOR_CTORback to summary
private static final Constructor<? extends StAXConnector> FI_CONNECTOR_CTOR
FI_STAX_READER_CLASSback to summary
private static final Class<T> FI_STAX_READER_CLASS

Reference to FI's StAXReader class, if FI can be loaded.

STAX_EX_CONNECTOR_CTORback to summary
private static final Constructor<? extends StAXConnector> STAX_EX_CONNECTOR_CTOR
STAX_EX_READER_CLASSback to summary
private static final Class<T> STAX_EX_READER_CLASS
staxStreamReaderback to summary
private final XMLStreamReader staxStreamReader
textReportedback to summary
protected boolean textReported

Set to true if the text() event is reported, and therefore the following text() event should be suppressed.

Constructor Detail

StAXStreamConnectorback to summary
protected StAXStreamConnector(XMLStreamReader staxStreamReader, XmlVisitor visitor)

Method Detail

bridgeback to summary
public void bridge() throws XMLStreamException

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector.bridge.

Annotations
@Override
checkImplementaionNameOfSjsxpback to summary
private static boolean checkImplementaionNameOfSjsxp(XMLStreamReader reader)
createback to summary
public static StAXConnector create(XMLStreamReader reader, XmlVisitor visitor)

Creates a StAXConnector from XMLStreamReader. This method checks if the parser is FI parser and acts accordingly.

getBoolPropback to summary
private static boolean getBoolProp(XMLStreamReader r, String n)
getCurrentLocationback to summary
protected Location getCurrentLocation()

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector.getCurrentLocation.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector.getCurrentLocation.

Gets the Location. Used for implementing the line number information.

Annotations
@Override
getCurrentQNameback to summary
protected String getCurrentQName()

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector.getCurrentQName.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StAXConnector.getCurrentQName.

Gets the QName of the current element.

Annotations
@Override
handleCharactersback to summary
protected void handleCharacters() throws XMLStreamException, SAXException
handleEndElementback to summary
private void handleEndElement() throws SAXException
handleStartElementback to summary
private void handleStartElement() throws SAXException
initFastInfosetConnectorClassback to summary
private static Constructor<? extends StAXConnector> initFastInfosetConnectorClass()
initFIStAXReaderClassback to summary
private static Class<T> initFIStAXReaderClass()
initStAXExConnectorback to summary
private static Constructor<? extends StAXConnector> initStAXExConnector()
initStAXExReaderback to summary
private static Class<T> initStAXExReader()
processTextback to summary
private void processText(boolean ignorable) throws SAXException