public class SimpleValueReader extends ValueReader
ValueReader
used for simple scalar types and related,
not including POJO-, Map
and Collection
types.Modifier and Type | Field and Description |
---|---|
protected int |
_typeId |
_valueType
Constructor and Description |
---|
SimpleValueReader(Class<?> raw,
int typeId) |
Modifier and Type | Method and Description |
---|---|
protected long |
_fetchLong(JsonParser p) |
protected byte[] |
_readBinary(JsonParser p) |
protected int[] |
_readIntArray(JsonParser p) |
Object |
read(JSONReader reader,
JsonParser p)
Method called to deserialize value of type supported by this reader, using
given parser.
|
Object |
readNext(JSONReader reader,
JsonParser p)
Method called to deserialize value of type supported by this reader, using
given parser.
|
_tokenDesc, _tokenDesc, valueType
public SimpleValueReader(Class<?> raw, int typeId)
public Object readNext(JSONReader reader, 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
reader
- 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 reader, JsonParser p) throws IOException
ValueReader
read
in class ValueReader
reader
- 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
protected byte[] _readBinary(JsonParser p) throws IOException
IOException
protected int[] _readIntArray(JsonParser p) throws IOException
IOException
protected long _fetchLong(JsonParser p) throws IOException
IOException
Copyright © 2020 FasterXML. All rights reserved.