Package com.alibaba.fastjson2.reader
Class ObjectReaderBean<T>
java.lang.Object
com.alibaba.fastjson2.reader.ObjectReaderBean<T>
- All Implemented Interfaces:
ObjectReader<T>
- Direct Known Subclasses:
ObjectReaderAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JSONReader.AutoTypeBeforeHandlerprotected final Functionprotected FieldReaderprotected final longprotected booleanprotected final Classprotected final JSONSchemaprotected final booleanprotected final Stringprotected final longFields inherited from interface com.alibaba.fastjson2.reader.ObjectReader
HASH_TYPE, VALUE_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObjectReaderBean(Class objectClass, Supplier<T> creator, String typeName, long features, JSONSchema schema, Function buildFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptExtra(Object object, String fieldName, Object fieldValue, long features) Accepts extra field data that is not mapped to any specific field in the object.final ObjectReadercheckAutoType(JSONReader jsonReader, long features) final ObjectReadercheckAutoType(JSONReader jsonReader, Class expectClass, long features) Deprecated.protected final ObjectReadercheckAutoType0(JSONReader jsonReader, long features) Gets the class of objects that this ObjectReader can deserialize.protected voidinitDefaultValue(T object) protected voidinitStringFieldAsEmpty(Object object) protected voidprocessExtra(JSONReader jsonReader, Object object) protected voidprocessExtra(JSONReader jsonReader, Object object, long features) protected TprocessObjectInputSingleItemArray(JSONReader jsonReader, Type fieldType, Object fieldName, long features) protected booleanreadFieldValueWithLCase(JSONReader jsonReader, Object object, long hashCode64, long features2) voidreadObject(JSONReader jsonReader, Object object, long features) readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) Reads an object from the specified JSONReader with the given field type, field name, and features.voidsetAutoTypeBeforeHandler(JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.fastjson2.reader.ObjectReader
accept, acceptExtra, autoType, autoType, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstanceNoneDefaultConstructor, getBuildFunction, getFeatures, getFieldReader, getFieldReader, getFieldReaderLCase, getTypeKey, getTypeKeyHash, readArrayMappingJSONBObject, readArrayMappingObject, readJSONBObject, readObject, readObject, readObject, setFieldValue, setFieldValue, setFieldValue
-
Field Details
-
objectClass
-
creator
-
buildFunction
-
features
protected final long features -
typeName
-
typeNameHash
protected final long typeNameHash -
extraFieldReader
-
hasDefaultValue
protected boolean hasDefaultValue -
serializable
protected final boolean serializable -
schema
-
autoTypeBeforeHandler
-
-
Constructor Details
-
ObjectReaderBean
-
-
Method Details
-
getObjectClass
Description copied from interface:ObjectReaderGets the class of objects that this ObjectReader can deserialize.- Specified by:
getObjectClassin interfaceObjectReader<T>- Returns:
- the object class, or null if not specified
-
processObjectInputSingleItemArray
protected T processObjectInputSingleItemArray(JSONReader jsonReader, Type fieldType, Object fieldName, long features) -
processExtra
-
processExtra
-
acceptExtra
Description copied from interface:ObjectReaderAccepts extra field data that is not mapped to any specific field in the object. This method is called when deserializing JSON objects that contain fields not present in the target class.- Specified by:
acceptExtrain interfaceObjectReader<T>- Parameters:
object- the object being deserializedfieldName- the name of the extra fieldfieldValue- the value of the extra fieldfeatures- the JSON reader features to use
-
checkAutoType
@Deprecated public final ObjectReader checkAutoType(JSONReader jsonReader, Class expectClass, long features) Deprecated. -
checkAutoType
-
checkAutoType0
-
initDefaultValue
-
readObject
-
readObject
Description copied from interface:ObjectReaderReads an object from the specified JSONReader with the given field type, field name, and features.- Specified by:
readObjectin interfaceObjectReader<T>- Parameters:
jsonReader- the JSONReader to use for parsingfieldType- the type of the field being readfieldName- the name of the field being readfeatures- the features to use- Returns:
- the deserialized object
-
initStringFieldAsEmpty
-
getAutoTypeBeforeHandler
-
setAutoTypeBeforeHandler
-
readFieldValueWithLCase
protected boolean readFieldValueWithLCase(JSONReader jsonReader, Object object, long hashCode64, long features2)
-