public class AnyReader extends ValueReader
ValueReader
used for "untyped" values; ones that are bound
to whatever Object
is the natural mapping to JSON
value that parser currently points toModifier and Type | Field and Description |
---|---|
static AnyReader |
std |
_valueType
Constructor and Description |
---|
AnyReader() |
Modifier and Type | Method and Description |
---|---|
protected Object |
fromBoolean(boolean b)
Method called to let implementation change a
Boolean value that has been
read from input. |
protected Object |
fromEmbedded(Object value) |
protected String |
fromKey(String key)
Method called to let implementation change a key of an Object field
after being parsed from input.
|
protected Object |
fromNull()
Method called to let implementation change a null value that has been
read from input.
|
protected Object |
fromString(String str)
Method called to let implementation change a
String value that has been
read from input. |
Object |
read(JSONReader r,
JsonParser p)
Method called to deserialize value of type supported by this reader, using
given parser.
|
Object[] |
readArrayFromArray(JSONReader r,
JsonParser p,
CollectionBuilder b) |
Collection<Object> |
readCollectionFromArray(JSONReader r,
JsonParser p,
CollectionBuilder b) |
Map<String,Object> |
readFromObject(JSONReader r,
JsonParser p,
MapBuilder b) |
Object |
readNext(JSONReader r,
JsonParser p)
Method called to deserialize value of type supported by this reader, using
given parser.
|
_tokenDesc, _tokenDesc, valueType
public static final AnyReader std
public Object readNext(JSONReader r, JsonParser p) throws IOException
ValueReader
Default implementation simply calls `p.nextToken()` first, then calls
{#link ValueReader.read(JSONReader, JsonParser)
, but some implementations
may decide to implement this differently to use (slightly) more efficient
accessor in JsonParser
, like JsonParser.nextIntValue(int)
.
readNext
in class ValueReader
r
- Context object that allows calling other read methods for contained
values of different types (for example for collection readers).p
- Underlying parser used for reading decoded token streamIOException
public Object read(JSONReader r, JsonParser p) throws IOException
ValueReader
read
in class ValueReader
r
- Context object that allows calling other read methods for contained
values of different types (for example for collection readers).p
- Underlying parser used for reading decoded token streamIOException
public Map<String,Object> readFromObject(JSONReader r, JsonParser p, MapBuilder b) throws IOException
IOException
public Object[] readArrayFromArray(JSONReader r, JsonParser p, CollectionBuilder b) throws IOException
IOException
public Collection<Object> readCollectionFromArray(JSONReader r, JsonParser p, CollectionBuilder b) throws IOException
IOException
protected Object fromNull() throws IOException
IOException
protected Object fromBoolean(boolean b) throws IOException
Boolean
value that has been
read from input.
Default implementation returns Boolean value as is.IOException
protected String fromKey(String key) throws IOException
IOException
protected Object fromString(String str) throws IOException
String
value that has been
read from input.
Default implementation returns String value as is.IOException
protected Object fromEmbedded(Object value) throws IOException
IOException
Copyright © 2020 FasterXML. All rights reserved.