Class ObjectReaderBean<T>

java.lang.Object
com.alibaba.fastjson2.reader.ObjectReaderBean<T>
All Implemented Interfaces:
ObjectReader<T>
Direct Known Subclasses:
ObjectReaderAdapter

public abstract class ObjectReaderBean<T> extends Object implements ObjectReader<T>
  • Field Details

    • objectClass

      protected final Class objectClass
    • creator

      protected final Supplier<T> creator
    • buildFunction

      protected final Function buildFunction
    • features

      protected final long features
    • typeName

      protected final String typeName
    • typeNameHash

      protected final long typeNameHash
    • extraFieldReader

      protected FieldReader extraFieldReader
    • hasDefaultValue

      protected boolean hasDefaultValue
    • serializable

      protected final boolean serializable
    • schema

      protected final JSONSchema schema
    • autoTypeBeforeHandler

      protected JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler
  • Constructor Details

  • Method Details

    • getObjectClass

      public Class<T> getObjectClass()
      Description copied from interface: ObjectReader
      Gets the class of objects that this ObjectReader can deserialize.
      Specified by:
      getObjectClass in interface ObjectReader<T>
      Returns:
      the object class, or null if not specified
    • processObjectInputSingleItemArray

      protected T processObjectInputSingleItemArray(JSONReader jsonReader, Type fieldType, Object fieldName, long features)
    • processExtra

      protected void processExtra(JSONReader jsonReader, Object object)
    • processExtra

      protected void processExtra(JSONReader jsonReader, Object object, long features)
    • acceptExtra

      public void acceptExtra(Object object, String fieldName, Object fieldValue, long features)
      Description copied from interface: ObjectReader
      Accepts 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:
      acceptExtra in interface ObjectReader<T>
      Parameters:
      object - the object being deserialized
      fieldName - the name of the extra field
      fieldValue - the value of the extra field
      features - the JSON reader features to use
    • checkAutoType

      @Deprecated public final ObjectReader checkAutoType(JSONReader jsonReader, Class expectClass, long features)
      Deprecated.
    • checkAutoType

      public final ObjectReader checkAutoType(JSONReader jsonReader, long features)
    • checkAutoType0

      protected final ObjectReader checkAutoType0(JSONReader jsonReader, long features)
    • initDefaultValue

      protected void initDefaultValue(T object)
    • readObject

      public void readObject(JSONReader jsonReader, Object object, long features)
    • readObject

      public T readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features)
      Description copied from interface: ObjectReader
      Reads an object from the specified JSONReader with the given field type, field name, and features.
      Specified by:
      readObject in interface ObjectReader<T>
      Parameters:
      jsonReader - the JSONReader to use for parsing
      fieldType - the type of the field being read
      fieldName - the name of the field being read
      features - the features to use
      Returns:
      the deserialized object
    • initStringFieldAsEmpty

      protected void initStringFieldAsEmpty(Object object)
    • getAutoTypeBeforeHandler

      public JSONReader.AutoTypeBeforeHandler getAutoTypeBeforeHandler()
    • setAutoTypeBeforeHandler

      public void setAutoTypeBeforeHandler(JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler)
    • readFieldValueWithLCase

      protected boolean readFieldValueWithLCase(JSONReader jsonReader, Object object, long hashCode64, long features2)