|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.dataformat.xml.deser.XmlTokenStream
public class XmlTokenStream
Simple helper class used on top of STAX XMLStreamReader
to further
abstract out all irrelevant details, and to expose equivalent of flat token
stream with no "fluff" tokens (comments, processing instructions, mixed
content) all of which is just to simplify
actual higher-level conversion to JSON tokens
Field Summary | |
---|---|
protected int |
_attributeCount
|
protected int |
_currentState
|
protected com.fasterxml.jackson.dataformat.xml.deser.ElementWrapper |
_currentWrapper
Wrapping state, if any active (null if none) |
protected String |
_localName
|
protected String |
_namespaceURI
|
protected int |
_nextAttributeIndex
Index of the next attribute of the current START_ELEMENT to return (as field name and value pair), if any; -1 when no attributes to return |
protected String |
_nextLocalName
In cases where we need to 'inject' a virtual END_ELEMENT, we may also need to restore START_ELEMENT afterwards; if so, this is where names are held. |
protected String |
_nextNamespaceURI
|
protected int |
_repeatElement
Flag used to indicate that given element should be "replayed". |
protected Object |
_sourceReference
|
protected String |
_textValue
|
protected org.codehaus.stax2.XMLStreamReader2 |
_xmlReader
|
static int |
XML_ATTRIBUTE_NAME
|
static int |
XML_ATTRIBUTE_VALUE
|
static int |
XML_END
|
static int |
XML_END_ELEMENT
|
static int |
XML_START_ELEMENT
|
static int |
XML_TEXT
|
Constructor Summary | |
---|---|
XmlTokenStream(XMLStreamReader xmlReader,
Object sourceRef)
|
Method Summary | |
---|---|
protected int |
_handleRepeatElement()
Method called to handle details of repeating "virtual" start/end elements, needed for handling 'unwrapped' lists. |
void |
close()
|
void |
closeCompletely()
|
protected String |
convertToString()
|
com.fasterxml.jackson.core.JsonLocation |
getCurrentLocation()
|
int |
getCurrentToken()
|
String |
getLocalName()
|
String |
getNamespaceURI()
|
String |
getText()
|
com.fasterxml.jackson.core.JsonLocation |
getTokenLocation()
|
org.codehaus.stax2.XMLStreamReader2 |
getXmlReader()
|
boolean |
hasAttributes()
|
int |
next()
|
protected void |
repeatStartElement()
Method used to add virtual wrapping, which just duplicates START_ELEMENT stream points to, and its matching closing element. |
protected void |
skipAttributes()
Method called to skip any attributes current START_ELEMENT may have, so that they are not returned as token. |
void |
skipEndElement()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int XML_START_ELEMENT
public static final int XML_END_ELEMENT
public static final int XML_ATTRIBUTE_NAME
public static final int XML_ATTRIBUTE_VALUE
public static final int XML_TEXT
public static final int XML_END
protected final org.codehaus.stax2.XMLStreamReader2 _xmlReader
protected final Object _sourceReference
protected int _currentState
protected int _attributeCount
protected int _nextAttributeIndex
protected String _localName
protected String _namespaceURI
protected String _textValue
protected int _repeatElement
protected com.fasterxml.jackson.dataformat.xml.deser.ElementWrapper _currentWrapper
protected String _nextLocalName
protected String _nextNamespaceURI
Constructor Detail |
---|
public XmlTokenStream(XMLStreamReader xmlReader, Object sourceRef)
Method Detail |
---|
public org.codehaus.stax2.XMLStreamReader2 getXmlReader()
public int next() throws IOException
IOException
public void skipEndElement() throws IOException
IOException
public int getCurrentToken()
public String getText()
public String getLocalName()
public String getNamespaceURI()
public boolean hasAttributes()
public void closeCompletely() throws IOException
IOException
public void close() throws IOException
IOException
public com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
public com.fasterxml.jackson.core.JsonLocation getTokenLocation()
protected void repeatStartElement()
protected void skipAttributes()
protected String convertToString() throws IOException
IOException
protected int _handleRepeatElement() throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |