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

public Class BeanReader

extends ValueReader
Class Inheritance
Imports
java.util.*, tools.jackson.core.*, tools.jackson.core.sym.PropertyNameMatcher, tools.jackson.core.util.Named, tools.jackson.jr.ob.JSON, .JSONObjectException, tools.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 boolean
protected final BeanConstructors
protected final Set<String>
protected final boolean
protected PropertyNameMatcher
protected final Map<String, BeanPropertyReader>
protected BeanPropertyReader[]
protected final Object[]
_recordNullValues

Array that contains default null values for POJO/Record properties; needed for primitive types for which null is not a valid value.

Inherited from tools.jackson.jr.ob.api.ValueReader:
_valueType

Constructor Summary

AccessConstructor and Description
protected
BeanReader(Class<?> type, Map<String, BeanPropertyReader> propsByName, BeanConstructors constructors, Set<String> ignorableNames, Map<String, String> aliasMapping, boolean caseInsensitive)

Constructors used for deserialization use case

Method Summary

Modifier and TypeMethod and Description
private final Map<String, BeanPropertyReader>
private final Object
private final Object
_readWithUnknown(JSONReader r, JsonParser p, final Object bean, String propName)

protected Object
protected JacksonException
public static BeanReader
construct(Class<?> type, Map<String, BeanPropertyReader> props, BeanConstructors constructors, Set<String> ignorableProps, Map<String, String> aliasMapping, boolean caseInsensitive)

public BeanPropertyReader
protected void
handleUnknown(JSONReader reader, JsonParser parser, String fieldName)

protected void
initPropertyMatcher(TokenStreamFactory streamFactory)

Initialization method called after construction and resolution of all property readers: separate since caller needs to handle resolution of cyclic dependencies.

private Object
nullValue(Class<?> aClass)

public Map<String, BeanPropertyReader>
public Object
read(JSONReader r, JsonParser p)

Implements abstract tools.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 r, JsonParser p)

Overrides tools.jackson.jr.ob.api.ValueReader.readNext.

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

private Object
Inherited from tools.jackson.jr.ob.api.ValueReader:
_tokenDesc_tokenDesc_valueTypeDescvalueType

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

_caseInsensitiveback to summary
protected final boolean _caseInsensitive
_constructorsback to summary
protected final BeanConstructors _constructors
_ignorableNamesback to summary
protected final Set<String> _ignorableNames
_isRecordTypeback to summary
protected final boolean _isRecordType
_propNameMatcherback to summary
protected PropertyNameMatcher _propNameMatcher
_propsByNameback to summary
protected final Map<String, BeanPropertyReader> _propsByName
_propValueReadersback to summary
protected BeanPropertyReader[] _propValueReaders
_recordNullValuesback to summary
protected final Object[] _recordNullValues

Array that contains default null values for POJO/Record properties; needed for primitive types for which null is not a valid value.

Constructor Detail

BeanReaderback to summary
protected BeanReader(Class<?> type, Map<String, BeanPropertyReader> propsByName, BeanConstructors constructors, Set<String> ignorableNames, Map<String, String> aliasMapping, boolean caseInsensitive)

Constructors used for deserialization use case

Method Detail

_mixInAliasesback to summary
private final Map<String, BeanPropertyReader> _mixInAliases(Map<String, BeanPropertyReader> props, Map<String, String> aliases)
_readBeanback to summary
private final Object _readBean(JSONReader r, JsonParser p, final Object bean) throws JacksonException
_readWithUnknownback to summary
private final Object _readWithUnknown(JSONReader r, JsonParser p, final Object bean, String propName) throws JacksonException
_reportFailureToCreateback to summary
protected Object _reportFailureToCreate(JsonParser p, Exception e) throws JacksonException
_reportProblemback to summary
protected JacksonException _reportProblem(JsonParser p)
constructback to summary
public static BeanReader construct(Class<?> type, Map<String, BeanPropertyReader> props, BeanConstructors constructors, Set<String> ignorableProps, Map<String, String> aliasMapping, boolean caseInsensitive)
Since
3.0
findPropertyback to summary
public BeanPropertyReader findProperty(String name)
handleUnknownback to summary
protected void handleUnknown(JSONReader reader, JsonParser parser, String fieldName) throws JacksonException
initPropertyMatcherback to summary
protected void initPropertyMatcher(TokenStreamFactory streamFactory)

Initialization method called after construction and resolution of all property readers: separate since caller needs to handle resolution of cyclic dependencies.

nullValueback to summary
private Object nullValue(Class<?> aClass)
propertiesByNameback to summary
public Map<String, BeanPropertyReader> propertiesByName()
readback to summary
public Object read(JSONReader r, JsonParser p) throws JacksonException

Implements abstract tools.jackson.jr.ob.api.ValueReader.read.

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

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

Overrides tools.jackson.jr.ob.api.ValueReader.readNext.

Doc from tools.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 accessors in JsonParser, like JsonParser#nextIntValue(int).

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