Class XmlTokenStream
java.lang.Object
com.fasterxml.jackson.dataformat.xml.deser.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.
Beyond initial idea there are also couple of other detours like ability to "replay" some tokens, add virtual wrappers (ironically to support "unwrapped" array values), and to unroll "Objects" into String values in some cases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionXmlTokenStream(XMLStreamReader xmlReader, ContentReference sourceRef, int formatFeatures, XmlNameProcessor nameProcessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidintAccessor for local name of current named event (that is,XML_START_ELEMENTorXML_ATTRIBUTE_NAME).getText()org.codehaus.stax2.XMLStreamReader2booleanintSecond part of initialization, to be called immediately after constructionintnext()void
-
Field Details
-
XML_START_ELEMENT
public static final int XML_START_ELEMENT- See Also:
-
XML_END_ELEMENT
public static final int XML_END_ELEMENT- See Also:
-
XML_ATTRIBUTE_NAME
public static final int XML_ATTRIBUTE_NAME- See Also:
-
XML_ATTRIBUTE_VALUE
public static final int XML_ATTRIBUTE_VALUE- See Also:
-
XML_TEXT
public static final int XML_TEXT- See Also:
-
XML_ROOT_TEXT
public static final int XML_ROOT_TEXT- See Also:
-
XML_END
public static final int XML_END- See Also:
-
-
Constructor Details
-
XmlTokenStream
public XmlTokenStream(XMLStreamReader xmlReader, ContentReference sourceRef, int formatFeatures, XmlNameProcessor nameProcessor)
-
-
Method Details
-
initialize
Second part of initialization, to be called immediately after construction- Throws:
XMLStreamException- Since:
- 2.12
-
getXmlReader
public org.codehaus.stax2.XMLStreamReader2 getXmlReader() -
next
- Throws:
XMLStreamException
-
skipEndElement
- Throws:
IOExceptionXMLStreamException
-
getCurrentToken
public int getCurrentToken() -
getText
-
getLocalName
Accessor for local name of current named event (that is,XML_START_ELEMENTorXML_ATTRIBUTE_NAME).NOTE: name NOT accessible on
XML_END_ELEMENT -
getNamespaceURI
-
hasXsiNil
public boolean hasXsiNil() -
closeCompletely
- Throws:
XMLStreamException
-
close
- Throws:
XMLStreamException
-
getCurrentLocation
-
getTokenLocation
-