JsonParser implementation that exposes XML structure as
set of JSON events that can be used for data binding.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | FromXmlParser.
Enumeration that defines all togglable features for XML parsers. |
| Modifier and Type | Field and Description |
|---|---|
| protected byte[] | _binaryValue
We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
|
| protected ByteArrayBuilder | _byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called. |
| protected String | _cfgNameForTextElement
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. |
| protected boolean | _closed
Flag that indicates whether parser is closed or not. |
| protected String | |
| protected int | _formatFeatures
Bit flag composed of bits that indicate which
|
| protected final IOContext | |
| protected boolean | _mayBeLeaf
We need special handling to keep track of whether a value may be exposed as simple leaf value. |
| protected boolean | _nextIsLeadingMixed
Additional flag that is strictly needed when exposing "mixed" leading String value as "anonymous" property/string pair. |
| protected JsonToken | |
| protected BigInteger | |
| protected int | |
| protected long | |
| protected int | _numTypesValid
Bitfield that indicates which numeric representations have been calculated for the current type |
| protected ObjectCodec | |
| protected XmlReadContext | _parsingContext
Information about parser context, context in which the next token is to be parsed (root, array, object). |
| protected final XmlTokenStream | |
| public static final String | DEFAULT_UNNAMED_TEXT_PROPERTY
The default name placeholder for XML text segments is empty String (""). |
| protected static final JacksonFeatureSet | XML_READ_CAPABILITIES
XML format has some peculiarities, indicated via new (2.12) capability system. |
| Access | Constructor and Description |
|---|---|
| public | FromXmlParser(IOContext ctxt, int genericParserFeatures, int xmlFeatures, ObjectCodec codec, XMLStreamReader xmlReader, XmlNameProcessor tagProcessor)
|
| Modifier and Type | Method and Description |
|---|---|
| protected final void | |
| protected BigDecimal | |
| protected void | |
| protected double | |
| protected float | |
| protected void | |
| protected void | |
| protected byte[] | |
| protected ByteArrayBuilder | |
| protected void | _handleEOF()
Implements abstract com. Method called when an EOF is encountered between tokens. |
| private <T> T | |
| protected final int | |
| protected int | |
| protected void | |
| protected void | |
| private void | |
| public void | addVirtualWrapping(Set<String> namesToWrap0, boolean caseInsensitive)
Implements com. Method that may be called to indicate that specified names (only local parts retained currently: this may be changed in future) should be considered "auto-wrapping", meaning that they will be doubled to contain two opening elements, two matching closing elements. |
| public boolean | canReadObjectId()
Overrides com. Introspection method that may be called to see if the underlying data format supports some kind of Object Ids natively (many do not; for example, JSON doesn't). |
| public boolean | canReadTypeId()
Overrides com. Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't). |
| public void | close()
Implements abstract com. Implements java. Closes the parser so that no further iteration or data access
can be made; will also close the underlying input source
if parser either owns the input source, or feature
|
| public FromXmlParser | |
| public JsonLocation | currentLocation()
Overrides com. Method that returns location of the last processed character; usually for error reporting purposes |
| public String | currentName()
Overrides com. Method that can be called to get the name associated with the current event. |
| public JsonLocation | currentTokenLocation()
Overrides com. Method that return the starting location of the current token; that is, position of the first character from input that starts the current token. |
| public FromXmlParser | |
| public FromXmlParser | |
| public BigInteger | getBigIntegerValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public byte[] | getBinaryValue(Base64Variant
Expected variant of base64 encoded
content (see b64variant)Base64Variants for definitions
of "standard" variants).Implements abstract com. Method that can be used to read (and consume -- results may not be accessible using other methods after the call) base64-encoded binary data included in the current textual JSON value. |
| public ObjectCodec | getCodec()
Implements abstract com. Accessor for |
| public JsonLocation | getCurrentLocation()
Implements abstract com.
Deprecated
Deprecated alias for |
| public String | getCurrentName()
Implements abstract com.
Deprecated
Deprecated alias of |
| public BigDecimal | getDecimalValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public double | getDoubleValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public Object | getEmbeddedObject()
Overrides com. Accessor that can be called if (and only if) the current token
is |
| public float | getFloatValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public int | getFormatFeatures()
Overrides com. Bulk access method for getting state of all |
| public int | getIntValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public long | getLongValue()
Implements abstract com. Numeric accessor that can be called when the current
token is of type |
| public JsonParser. | getNumberType()
Implements abstract com. If current token is of type
|
| public JsonParser. | getNumberTypeFP()
Overrides com. XML has no notion of natural/native floating-point type (has to be provided externally via Schema or so), so need to ensure we indicate that. |
| public Number | getNumberValue()
Implements abstract com. Generic number value accessor method that will work for all kinds of numeric values. |
| public XmlReadContext | getParsingContext()
Implements abstract com. Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information. |
| public JacksonFeatureSet | getReadCapabilities()
Overrides com. Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly). |
| public XMLStreamReader | |
| public String | getText()
Implements abstract com. Method for accessing textual representation of the current token;
if no current token (before first call to |
| public int | getText(Writer
Writer to write textual content to writer)Overrides com. Method to read the textual representation of the current token in chunks and pass it to the given Writer. |
| public char[] | getTextCharacters()
Implements abstract com. Method similar to |
| public int | getTextLength()
Implements abstract com. Accessor used with |
| public int | getTextOffset()
Implements abstract com. Accessor used with |
| public JsonLocation | getTokenLocation()
Implements abstract com.
Deprecated
Deprecated alias for |
| public boolean | hasTextCharacters()
Implements abstract com. XML input actually would offer access to character arrays; but since we must coalesce things it cannot really be exposed. |
| public boolean | isClosed()
Implements abstract com. Method that can be called to determine whether this parser is closed or not. |
| public final boolean | |
| public boolean | isExpectedNumberIntToken()
Overrides com. Since xml representation can not really distinguish between different scalar types (numbers, booleans) -- they are all just Character Data, without schema -- we can try to infer type from intent here. |
| public boolean | isExpectedStartArrayToken()
Overrides com. 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 expectation is that the current start element is to mean 'start array', instead of default of 'start object'. |
| public boolean | isNaN()
Overrides com. Accessor for checking whether current token is a special "not-a-number" (NaN) token (including both "NaN" AND positive/negative infinity!). |
| public String | nextTextValue()
Overrides com. Method overridden to support more reliable deserialization of String collections. |
| public JsonToken | nextToken()
Implements abstract com. Main iteration method, which will advance stream enough to determine type of the next token, if any. |
| public void | overrideCurrentName(String
Name to use as the current name; may be null. name)Implements abstract com. Method that can be used to change what is considered to be the current (field) name. |
| public JsonParser | overrideFormatFeatures(int
Bit mask of set/clear state for features to change values, int Bit mask of features to change mask)Overrides com. Bulk set method for (re)setting states of |
| public boolean | Returns: True since XML format does require support from codecOverrides com. XML format does require support from custom |
| public void | setCodec(ObjectCodec
Codec to assign, if any; c)null if noneImplements abstract com. Setter that allows defining |
| public void | |
| public Version | version()
Implements abstract com. Implements com. Accessor for getting version of the core package, given a parser instance. |