Top Description Fields Constructors Methods
com.fasterxml.jackson.jr.ob.api

public abstract Class ValueReader

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.jr.ob.impl.AnyReader, com.fasterxml.jackson.jr.ob.impl.ArrayReader, com.fasterxml.jackson.jr.ob.impl.BeanReader, com.fasterxml.jackson.jr.ob.impl.CollectionReader, com.fasterxml.jackson.jr.ob.impl.EnumReader, com.fasterxml.jackson.jr.ob.impl.MapReader, com.fasterxml.jackson.jr.ob.impl.SimpleValueReader
Imports
java.io.IOException, com.fasterxml.jackson.core.JsonParser, .JsonToken, com.fasterxml.jackson.jr.ob.impl.JSONReader

API and base class for all "deserializer" implementations used to actually read values of Java types from (JSON) input.

Field Summary

Modifier and TypeField and Description
protected final Class<?>
_valueType

Type of values this reader will read

Constructor Summary

AccessConstructor and Description
protected
ValueReader(Class<?> valueType)

Method Summary

Modifier and TypeMethod and Description
public static String
_tokenDesc(JsonParser p)

Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.

public static String
_tokenDesc(JsonParser p, JsonToken t)

Helper method for getting description of given token for use in descriptions and exception messages.

public abstract Object
read(JSONReader
Context object that allows calling other read methods for contained values of different types (for example for collection readers).
reader
,
JsonParser
Underlying parser used for reading decoded token stream
p
)

Method called to deserialize value of type supported by this reader, using given parser.

public Object
readNext(JSONReader
Context object that allows calling other read methods for contained values of different types (for example for collection readers).
reader
,
JsonParser
Underlying parser used for reading decoded token stream
p
)

Method called to deserialize value of type supported by this reader, using given parser.

public Class<?>
valueType()

Accessor for non-generic (type-erased) type of values this reader produces from input.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_valueTypeback to summary
protected final Class<?> _valueType

Type of values this reader will read

Since
2.10

Constructor Detail

ValueReaderback to summary
protected ValueReader(Class<?> valueType)

Method Detail

_tokenDescback to summary
public static String _tokenDesc(JsonParser p) throws IOException

Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.

_tokenDescback to summary
public static String _tokenDesc(JsonParser p, JsonToken t) throws IOException

Helper method for getting description of given token for use in descriptions and exception messages.

readback to summary
public abstract Object read(JSONReader reader, JsonParser p) throws IOException

Method called to deserialize value of type supported by this reader, using given parser. Parser is already positioned to the (first) token of the value to read.

Parameters
reader:JSONReader

Context object that allows calling other read methods for contained values of different types (for example for collection readers).

p:JsonParser

Underlying parser used for reading decoded token stream

readNextback to summary
public Object readNext(JSONReader reader, JsonParser p) throws IOException

Method called to deserialize value of type supported by this reader, using given parser. Parser is not yet positioned to the (first) token of the value to read and needs to be advanced.

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).

Parameters
reader:JSONReader

Context object that allows calling other read methods for contained values of different types (for example for collection readers).

p:JsonParser

Underlying parser used for reading decoded token stream

valueTypeback to summary
public Class<?> valueType()

Accessor for non-generic (type-erased) type of values this reader produces from input.

Since
2.10