com.sun.xml.bind.v2.runtime.unmarshaller

Class StAXStreamConnector

class StAXStreamConnector extends StAXConnector

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.

Field Summary
protected StringBuilderbuffer
SAX may fire consecutive characters event, but we don't allow it. so use this buffer to perform buffering.
protected booleantextReported
Set to true if the text() event is reported, and therefore the following text() event should be suppressed.
Constructor Summary
protected StAXStreamConnector(XMLStreamReader staxStreamReader, XmlVisitor visitor)
Method Summary
voidbridge()
static StAXConnectorcreate(XMLStreamReader reader, XmlVisitor visitor)
Creates a StAXConnector from XMLStreamReader.
static ClassLoadergetClassLoader()
protected LocationgetCurrentLocation()
protected StringgetCurrentQName()
protected voidhandleCharacters()

Field Detail

buffer

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

textReported

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

Constructor Detail

StAXStreamConnector

protected StAXStreamConnector(XMLStreamReader staxStreamReader, XmlVisitor visitor)

Method Detail

bridge

public void bridge()

create

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.

getClassLoader

public static ClassLoader getClassLoader()

getCurrentLocation

protected Location getCurrentLocation()

getCurrentQName

protected String getCurrentQName()

handleCharacters

protected void handleCharacters()