com.fasterxml.jackson.dataformat.xml.util
Class XmlTokenStream

java.lang.Object
  extended by com.fasterxml.jackson.dataformat.xml.util.XmlTokenStream

public class XmlTokenStream
extends Object

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

Since:
1.7

Field Summary
protected  int _attributeCount
           
protected  int _currentState
           
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  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
 void close()
           
 void closeCompletely()
           
 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()
           
 void skipEndElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_START_ELEMENT

public static final int XML_START_ELEMENT
See Also:
Constant Field Values

XML_END_ELEMENT

public static final int XML_END_ELEMENT
See Also:
Constant Field Values

XML_ATTRIBUTE_NAME

public static final int XML_ATTRIBUTE_NAME
See Also:
Constant Field Values

XML_ATTRIBUTE_VALUE

public static final int XML_ATTRIBUTE_VALUE
See Also:
Constant Field Values

XML_TEXT

public static final int XML_TEXT
See Also:
Constant Field Values

XML_END

public static final int XML_END
See Also:
Constant Field Values

_xmlReader

protected final org.codehaus.stax2.XMLStreamReader2 _xmlReader

_sourceReference

protected final Object _sourceReference

_currentState

protected int _currentState

_attributeCount

protected int _attributeCount

_nextAttributeIndex

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


_localName

protected String _localName

_namespaceURI

protected String _namespaceURI

_textValue

protected String _textValue
Constructor Detail

XmlTokenStream

public XmlTokenStream(XMLStreamReader xmlReader,
                      Object sourceRef)
Method Detail

getXmlReader

public org.codehaus.stax2.XMLStreamReader2 getXmlReader()

next

public int next()
         throws IOException
Throws:
IOException

skipEndElement

public void skipEndElement()
                    throws IOException
Throws:
IOException

getCurrentToken

public int getCurrentToken()

getText

public String getText()

getLocalName

public String getLocalName()

getNamespaceURI

public String getNamespaceURI()

hasAttributes

public boolean hasAttributes()

closeCompletely

public void closeCompletely()
                     throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

getCurrentLocation

public com.fasterxml.jackson.core.JsonLocation getCurrentLocation()

getTokenLocation

public com.fasterxml.jackson.core.JsonLocation getTokenLocation()


Copyright © 2012 fasterxml.com. All Rights Reserved.