Package com.fasterxml.jackson.jr.ob.impl
Class BeanReader
java.lang.Object
com.fasterxml.jackson.jr.ob.api.ValueReader
com.fasterxml.jackson.jr.ob.impl.BeanReader
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
FieldsModifier and TypeFieldDescriptionMapping of aliased names to primary names (direct linkage unfortunately impractical due to implementation limits).protected final BeanConstructorsprotected final booleanprotected final Map<String,BeanPropertyReader> protected final Object[]Array that contains default null values for POJO/Record properties; needed for primitive types for whichnullis not a valid value.Fields inherited from class com.fasterxml.jackson.jr.ob.api.ValueReader
_valueType -
Constructor Summary
ConstructorsConstructorDescriptionBeanReader(Class<?> type, Map<String, BeanPropertyReader> props, BeanConstructors constructors, Set<String> ignorableNames, Map<String, String> aliasMapping) Constructors used for deserialization use caseBeanReader(Class<?> type, Map<String, BeanPropertyReader> props, Constructor<?> defaultCtor, Constructor<?> stringCtor, Constructor<?> longCtor, Set<String> ignorableNames, Map<String, String> aliasMapping) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected IOException_reportProblem(com.fasterxml.jackson.core.JsonParser p) findProperty(String name) protected voidhandleUnknown(JSONReader reader, com.fasterxml.jackson.core.JsonParser parser, String fieldName) read(JSONReader r, com.fasterxml.jackson.core.JsonParser p) Method used for deserialization; will read an instance of the bean type using given parser.readNext(JSONReader r, com.fasterxml.jackson.core.JsonParser p) Method called to deserialize value of type supported by this reader, using given parser.Methods inherited from class com.fasterxml.jackson.jr.ob.api.ValueReader
_tokenDesc, _tokenDesc, _valueTypeDesc, valueType
-
Field Details
-
_propsByName
-
_aliasMapping
Mapping of aliased names to primary names (direct linkage unfortunately impractical due to implementation limits).- Since:
- 2.11
-
_ignorableNames
-
_constructors
- Since:
- 2.17
-
_isRecordType
protected final boolean _isRecordType -
_recordNullValues
Array that contains default null values for POJO/Record properties; needed for primitive types for whichnullis not a valid value.- Since:
- 2.21
-
-
Constructor Details
-
BeanReader
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
-
BeanReader
@Deprecated public BeanReader(Class<?> type, Map<String, BeanPropertyReader> props, Constructor<?> defaultCtor, Constructor<?> stringCtor, Constructor<?> longCtor, Set<String> ignorableNames, Map<String, String> aliasMapping) Deprecated.
-
-
Method Details
-
propertiesByName
-
findProperty
-
readNext
Description copied from class:ValueReaderMethod 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
ValueReader.read(JSONReader, JsonParser), but some implementations may decide to implement this differently to use (slightly) more efficient accessors inJsonParser, likeJsonParser.nextIntValue(int).- Overrides:
readNextin classValueReader- Parameters:
r- 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
-
read
Method used for deserialization; will read an instance of the bean type using given parser.- Specified by:
readin classValueReader- Parameters:
r- 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
-
handleUnknown
protected void handleUnknown(JSONReader reader, com.fasterxml.jackson.core.JsonParser parser, String fieldName) throws IOException - Throws:
IOException
-
_reportProblem
-