Top Description Fields Constructors Methods
tools.jackson.jr.ob.api

public abstract Class ValueReader

extends Object
Class Inheritance
Known Direct Subclasses
tools.jackson.jr.ob.impl.AnyReader, tools.jackson.jr.ob.impl.ArrayReader, tools.jackson.jr.ob.impl.BeanReader, tools.jackson.jr.ob.impl.CollectionReader, tools.jackson.jr.ob.impl.EnumReader, tools.jackson.jr.ob.impl.MapReader, tools.jackson.jr.ob.impl.SimpleValueReader
Imports
tools.jackson.core.JacksonException, .JsonParser, .JsonToken, tools.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.

protected static String
protected String
_valueTypeDesc()

Helper method for getting description of type of values this reader produces from input: used for example in exception messages.

public abstract Object
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

Constructor Detail

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

Method Detail

_tokenDescback to summary
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.

_tokenDescback to summary
protected static String _tokenDesc(JsonParser p, JsonToken t)
_valueTypeDescback to summary
protected String _valueTypeDesc()

Helper method for getting description of type of values this reader produces from input: used for example in exception messages.

readback to summary
public abstract Object read(JSONReader reader, JsonParser p) throws JacksonException
readNextback to summary
public Object readNext(JSONReader reader, JsonParser p) throws JacksonException

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 accessors 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