public abstract class ValueReader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
_valueType
Type of values this reader will read
|
| Modifier | Constructor and Description |
|---|---|
protected |
ValueReader(Class<?> valueType) |
| Modifier and Type | Method and Description |
|---|---|
static String |
_tokenDesc(JsonParser p)
Helper method for getting description of the token parser currently points to,
for use in descriptions and exception messages.
|
static String |
_tokenDesc(JsonParser p,
JsonToken t)
Helper method for getting description of given token
for use in descriptions and exception messages.
|
abstract 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.
|
Class<?> |
valueType()
Accessor for non-generic (type-erased) type of values this reader
produces from input.
|
protected final Class<?> _valueType
protected ValueReader(Class<?> valueType)
public abstract Object read(JSONReader reader, JsonParser p) throws IOException
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 streamIOExceptionpublic Object readNext(JSONReader reader, JsonParser p) throws IOException
Default implementation simply calls `p.nextToken()` first, then calls
{#link read(JSONReader, JsonParser), but some implementations
may decide to implement this differently to use (slightly) more efficient
accessor in JsonParser, like JsonParser.nextIntValue(int).
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 streamIOExceptionpublic Class<?> valueType()
public static String _tokenDesc(JsonParser p) throws IOException
IOExceptionpublic static String _tokenDesc(JsonParser p, JsonToken t) throws IOException
IOExceptionCopyright © 2025 FasterXML. All rights reserved.