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

public Class BeanReader

extends ValueReader
Class Inheritance
Imports
java.io.IOException, java.lang.reflect.Constructor, java.util.*, com.fasterxml.jackson.core.JsonParser, .JsonToken, com.fasterxml.jackson.jr.ob.JSON, .JSONObjectException, com.fasterxml.jackson.jr.ob.api.ValueReader

Class that contains information about dynamically introspected Bean types, to be able to deserialize (read) JSON into a POJO and serialize (write) POJO as JSON.

Field Summary

Modifier and TypeField and Description
protected final Map<String, String>
_aliasMapping

Mapping of aliased names to primary names (direct linkage unfortunately impractical due to implementation limits).

protected final BeanConstructors
protected final Set<String>
protected final boolean
protected final Map<String, BeanPropertyReader>
Inherited from com.fasterxml.jackson.jr.ob.api.ValueReader:
_valueType

Constructor Summary

AccessConstructor and Description
public
BeanReader(Class<?> type, Map<String, BeanPropertyReader> props, BeanConstructors constructors, Set<String> ignorableNames, Map<String, String> aliasMapping)

Constructors used for deserialization use case

public
BeanReader(Class<?> type, Map<String, BeanPropertyReader> props, Constructor<?> defaultCtor, Constructor<?> stringCtor, Constructor<?> longCtor, Set<String> ignorableNames, Map<String, String> aliasMapping)
Deprecated

Method Summary

Modifier and TypeMethod and Description
private final BeanPropertyReader
protected IOException
public BeanPropertyReader
protected void
handleUnknown(JSONReader reader, JsonParser parser, String fieldName)

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

Implements abstract com.fasterxml.jackson.jr.ob.api.ValueReader.read.

Method used for deserialization; will read an instance of the bean type 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).
r
,
JsonParser
Underlying parser used for reading decoded token stream
p
)

Overrides com.fasterxml.jackson.jr.ob.api.ValueReader.readNext.

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

private Object
Inherited from com.fasterxml.jackson.jr.ob.api.ValueReader:
_tokenDesc_tokenDescvalueType

Field Detail

_aliasMappingback to summary
protected final Map<String, String> _aliasMapping

Mapping of aliased names to primary names (direct linkage unfortunately impractical due to implementation limits).

Since
2.11
_constructorsback to summary
protected final BeanConstructors _constructors
Since
2.17
_ignorableNamesback to summary
protected final Set<String> _ignorableNames
_isRecordTypeback to summary
protected final boolean _isRecordType
_propsByNameback to summary
protected final Map<String, BeanPropertyReader> _propsByName

Constructor Detail

BeanReaderback to summary
public BeanReader(Class<?> type, Map<String, BeanPropertyReader> props, BeanConstructors constructors, Set<String> ignorableNames, Map<String, String> aliasMapping)

Constructors used for deserialization use case

Since
2.17
BeanReaderback to summary
public BeanReader(Class<?> type, Map<String, BeanPropertyReader> props, Constructor<?> defaultCtor, Constructor<?> stringCtor, Constructor<?> longCtor, Set<String> ignorableNames, Map<String, String> aliasMapping)

Deprecated

Annotations
@Deprecated

Method Detail

_findAliasback to summary
private final BeanPropertyReader _findAlias(String name)
_reportProblemback to summary
protected IOException _reportProblem(JsonParser p)
findPropertyback to summary
public BeanPropertyReader findProperty(String name)
handleUnknownback to summary
protected void handleUnknown(JSONReader reader, JsonParser parser, String fieldName) throws IOException
propertiesByNameback to summary
public Map<String, BeanPropertyReader> propertiesByName()
readback to summary
public Object read(JSONReader r, JsonParser p) throws IOException

Implements abstract com.fasterxml.jackson.jr.ob.api.ValueReader.read.

Method used for deserialization; will read an instance of the bean type using given parser.

Parameters
r:JSONReader

Doc from com.fasterxml.jackson.jr.ob.api.ValueReader.read.

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

p:JsonParser

Doc from com.fasterxml.jackson.jr.ob.api.ValueReader.read.

Underlying parser used for reading decoded token stream

Annotations
@Override
readNextback to summary
public Object readNext(JSONReader r, JsonParser p) throws IOException

Overrides com.fasterxml.jackson.jr.ob.api.ValueReader.readNext.

Doc from com.fasterxml.jackson.jr.ob.api.ValueReader.readNext.

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
r: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

Annotations
@Override
readRecordback to summary
private Object readRecord(JSONReader r, JsonParser p) throws Exception