Package com.fasterxml.jackson.jr.ob.api
Class ValueReader
java.lang.Object
com.fasterxml.jackson.jr.ob.api.ValueReader
- Direct Known Subclasses:
AnyReader,ArrayReader,BeanReader,CollectionReader,EnumReader,MapReader,SimpleValueReader
API and base class for all "deserializer" implementations used to actually read
values of Java types from (JSON) input.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String_tokenDesc(com.fasterxml.jackson.core.JsonParser p) Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.static String_tokenDesc(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.JsonToken t) Helper method for getting description of given token for use in descriptions and exception messages.protected StringHelper method for getting description of type of values this reader produces from input: used for example in exception messages.abstract Objectread(JSONReader reader, com.fasterxml.jackson.core.JsonParser p) Method called to deserialize value of type supported by this reader, using given parser.readNext(JSONReader reader, com.fasterxml.jackson.core.JsonParser p) Method called to deserialize value of type supported by this reader, using given parser.Class<?>Accessor for non-generic (type-erased) type of values this reader produces from input.
-
Field Details
-
_valueType
Type of values this reader will read- Since:
- 2.10
-
-
Constructor Details
-
ValueReader
-
-
Method Details
-
read
public abstract Object read(JSONReader reader, com.fasterxml.jackson.core.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- 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 stream- Throws:
IOException
-
readNext
public Object readNext(JSONReader reader, com.fasterxml.jackson.core.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 accessors inJsonParser, likeJsonParser.nextIntValue(int).- Parameters:
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 stream- Throws:
IOException
-
valueType
Accessor for non-generic (type-erased) type of values this reader produces from input.- Since:
- 2.10
-
_valueTypeDesc
Helper method for getting description of type of values this reader produces from input: used for example in exception messages.- Since:
- 2.20
-
_tokenDesc
Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.- Throws:
IOException
-
_tokenDesc
public static String _tokenDesc(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.JsonToken t) throws IOException Helper method for getting description of given token for use in descriptions and exception messages.- Throws:
IOException
-