|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fasterxml.jackson.core.JsonParser
com.fasterxml.jackson.core.base.ParserMinimalBase
com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser
public class FromXmlParser
JsonParser implementation that exposes XML structure as
set of JSON events that can be used for data binding.
| Nested Class Summary | |
|---|---|
static class |
FromXmlParser.Feature
Enumeration that defines all togglable features for XML parsers |
| Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
com.fasterxml.jackson.core.JsonParser.NumberType |
| Field Summary | |
|---|---|
protected byte[] |
_binaryValue
We will hold on to decoded binary data, for duration of current event, so that multiple calls to getBinaryValue(com.fasterxml.jackson.core.Base64Variant) will not need to decode data more
than once. |
protected com.fasterxml.jackson.core.util.ByteArrayBuilder |
_byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called. |
protected boolean |
_closed
Flag that indicates whether parser is closed or not. |
protected String |
_currText
|
protected com.fasterxml.jackson.core.io.IOContext |
_ioContext
|
protected boolean |
_mayBeLeaf
We need special handling to keep track of whether a value may be exposed as simple leaf value. |
protected com.fasterxml.jackson.core.JsonToken |
_nextToken
|
protected com.fasterxml.jackson.core.ObjectCodec |
_objectCodec
|
protected com.fasterxml.jackson.core.json.JsonReadContext |
_parsingContext
Information about parser context, context in which the next token is to be parsed (root, array, object). |
protected int |
_xmlFeatures
Bit flag composed of bits that indicate which FromXmlParser.Features
are enabled. |
protected XmlTokenStream |
_xmlTokens
|
protected static String |
UNNAMED_TEXT_PROPERTY
In cases where a start element has both attributes and non-empty textual value, we have to create a bogus property; we will use this as the property name. |
| Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase |
|---|
_currToken, _lastClearedToken, INT_APOSTROPHE, INT_ASTERISK, INT_b, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_f, INT_LBRACKET, INT_LCURLY, INT_LF, INT_n, INT_QUOTE, INT_r, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_t, INT_TAB, INT_u |
| Fields inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
_features |
| Constructor Summary | |
|---|---|
FromXmlParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int genericParserFeatures,
int xmlFeatures,
com.fasterxml.jackson.core.ObjectCodec codec,
XMLStreamReader xmlReader)
|
|
| Method Summary | |
|---|---|
protected byte[] |
_decodeBase64(com.fasterxml.jackson.core.Base64Variant b64variant)
|
protected com.fasterxml.jackson.core.util.ByteArrayBuilder |
_getByteArrayBuilder()
|
protected void |
_handleEOF()
Method called when an EOF is encountered between tokens. |
protected void |
_releaseBuffers()
Method called to release internal buffers owned by the base parser. |
protected void |
_reportBase64EOF()
|
protected void |
_reportInvalidBase64(com.fasterxml.jackson.core.Base64Variant b64variant,
char ch,
int bindex,
String msg)
|
void |
close()
|
FromXmlParser |
configure(FromXmlParser.Feature f,
boolean state)
|
FromXmlParser |
disable(FromXmlParser.Feature f)
|
FromXmlParser |
enable(FromXmlParser.Feature f)
|
BigInteger |
getBigIntegerValue()
|
byte[] |
getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)
|
com.fasterxml.jackson.core.ObjectCodec |
getCodec()
|
com.fasterxml.jackson.core.JsonLocation |
getCurrentLocation()
Method that returns location of the last processed character; usually for error reporting purposes |
String |
getCurrentName()
Method that can be called to get the name associated with the current event. |
BigDecimal |
getDecimalValue()
|
double |
getDoubleValue()
|
Object |
getEmbeddedObject()
|
float |
getFloatValue()
|
int |
getIntValue()
|
long |
getLongValue()
|
com.fasterxml.jackson.core.JsonParser.NumberType |
getNumberType()
|
Number |
getNumberValue()
|
com.fasterxml.jackson.core.json.JsonReadContext |
getParsingContext()
|
XMLStreamReader |
getStaxReader()
Method that allows application direct access to underlying Stax XMLStreamWriter. |
String |
getText()
|
char[] |
getTextCharacters()
|
int |
getTextLength()
|
int |
getTextOffset()
|
com.fasterxml.jackson.core.JsonLocation |
getTokenLocation()
Method that return the starting location of the current token; that is, position of the first character from input that starts the current token. |
boolean |
hasTextCharacters()
XML input actually would offer access to character arrays; but since we must coalesce things it cannot really be exposed. |
boolean |
isClosed()
|
boolean |
isEnabled(FromXmlParser.Feature f)
|
boolean |
isExpectedStartArrayToken()
Since xml representation can not really distinguish between array and object starts (both are represented with elements), this method is overridden and taken to mean that expecation is that the current start element is to mean 'start array', instead of default of 'start object'. |
com.fasterxml.jackson.core.JsonToken |
nextToken()
|
void |
overrideCurrentName(String name)
|
void |
setCodec(com.fasterxml.jackson.core.ObjectCodec c)
|
| Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase |
|---|
_constructError, _decodeBase64, _getCharDesc, _handleUnrecognizedCharacterEscape, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, clearCurrentToken, getCurrentToken, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, hasCurrentToken, nextValue, skipChildren, version |
| Methods inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
_constructError, canUseSchema, configure, disable, enable, getBinaryValue, getBooleanValue, getByteValue, getInputSource, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, isEnabled, nextBooleanValue, nextFieldName, nextIntValue, nextLongValue, nextTextValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, setSchema |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String UNNAMED_TEXT_PROPERTY
protected int _xmlFeatures
FromXmlParser.Features
are enabled.
protected com.fasterxml.jackson.core.ObjectCodec _objectCodec
protected boolean _closed
close()) or when end-of-input is reached.
protected final com.fasterxml.jackson.core.io.IOContext _ioContext
protected com.fasterxml.jackson.core.json.JsonReadContext _parsingContext
protected final XmlTokenStream _xmlTokens
protected boolean _mayBeLeaf
protected com.fasterxml.jackson.core.JsonToken _nextToken
protected String _currText
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _byteArrayBuilder
protected byte[] _binaryValue
getBinaryValue(com.fasterxml.jackson.core.Base64Variant) will not need to decode data more
than once.
| Constructor Detail |
|---|
public FromXmlParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int genericParserFeatures,
int xmlFeatures,
com.fasterxml.jackson.core.ObjectCodec codec,
XMLStreamReader xmlReader)
| Method Detail |
|---|
public com.fasterxml.jackson.core.ObjectCodec getCodec()
getCodec in class com.fasterxml.jackson.core.JsonParserpublic void setCodec(com.fasterxml.jackson.core.ObjectCodec c)
setCodec in class com.fasterxml.jackson.core.JsonParserpublic FromXmlParser enable(FromXmlParser.Feature f)
public FromXmlParser disable(FromXmlParser.Feature f)
public final boolean isEnabled(FromXmlParser.Feature f)
public FromXmlParser configure(FromXmlParser.Feature f,
boolean state)
public XMLStreamReader getStaxReader()
XMLStreamWriter. Note that use of writer is
discouraged, and may interfere with processing of this writer;
however, occasionally it may be necessary.
Note: writer instance will always be of type
XMLStreamWriter2 (including
Typed Access API) so upcasts are safe.
public String getCurrentName()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getCurrentName in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseExceptionpublic void overrideCurrentName(String name)
overrideCurrentName in class com.fasterxml.jackson.core.base.ParserMinimalBase
public void close()
throws IOException
close in interface Closeableclose in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic boolean isClosed()
isClosed in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic com.fasterxml.jackson.core.json.JsonReadContext getParsingContext()
getParsingContext in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic com.fasterxml.jackson.core.JsonLocation getTokenLocation()
getTokenLocation in class com.fasterxml.jackson.core.JsonParserpublic com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
getCurrentLocation in class com.fasterxml.jackson.core.JsonParserpublic boolean isExpectedStartArrayToken()
isExpectedStartArrayToken in class com.fasterxml.jackson.core.JsonParser
public com.fasterxml.jackson.core.JsonToken nextToken()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
nextToken in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseException
public String getText()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getText in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseException
public char[] getTextCharacters()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseException
public int getTextLength()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getTextLength in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseException
public int getTextOffset()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getTextOffset in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseExceptionpublic boolean hasTextCharacters()
hasTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBase
public Object getEmbeddedObject()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getEmbeddedObject in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getBinaryValue in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOException
com.fasterxml.jackson.core.JsonParseException
protected byte[] _decodeBase64(com.fasterxml.jackson.core.Base64Variant b64variant)
throws IOException,
com.fasterxml.jackson.core.JsonParseException
IOException
com.fasterxml.jackson.core.JsonParseException
protected void _reportInvalidBase64(com.fasterxml.jackson.core.Base64Variant b64variant,
char ch,
int bindex,
String msg)
throws com.fasterxml.jackson.core.JsonParseException
_reportInvalidBase64 in class com.fasterxml.jackson.core.base.ParserMinimalBasebindex - Relative index within base64 character unit; between 0
and 3 (as unit has exactly 4 characters)
com.fasterxml.jackson.core.JsonParseException
protected void _reportBase64EOF()
throws com.fasterxml.jackson.core.JsonParseException
_reportBase64EOF in class com.fasterxml.jackson.core.base.ParserMinimalBasecom.fasterxml.jackson.core.JsonParseException
public BigInteger getBigIntegerValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getBigIntegerValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public BigDecimal getDecimalValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getDecimalValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public double getDoubleValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getDoubleValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public float getFloatValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getFloatValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public int getIntValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getIntValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public long getLongValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getLongValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getNumberType in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
public Number getNumberValue()
throws IOException,
com.fasterxml.jackson.core.JsonParseException
getNumberValue in class com.fasterxml.jackson.core.JsonParserIOException
com.fasterxml.jackson.core.JsonParseException
protected void _handleEOF()
throws com.fasterxml.jackson.core.JsonParseException
_handleEOF in class com.fasterxml.jackson.core.base.ParserMinimalBasecom.fasterxml.jackson.core.JsonParseException
protected void _releaseBuffers()
throws IOException
IOExceptionprotected com.fasterxml.jackson.core.util.ByteArrayBuilder _getByteArrayBuilder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||