Class ObjectWriter1<T>

java.lang.Object
com.alibaba.fastjson2.writer.ObjectWriterAdapter<T>
com.alibaba.fastjson2.writer.ObjectWriter1<T>
All Implemented Interfaces:
ObjectWriter<T>

public class ObjectWriter1<T> extends ObjectWriterAdapter<T>
  • Field Details

  • Constructor Details

  • Method Details

    • write

      public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features)
      Description copied from interface: ObjectWriter
      Writes an object to the JSONWriter with the given field name, field type, and features.
      Specified by:
      write in interface ObjectWriter<T>
      Overrides:
      write in class ObjectWriterAdapter<T>
      Parameters:
      jsonWriter - the JSONWriter to which the object should be written
      object - the object to write
      fieldName - the name of the field being written
      fieldType - the type of the field being written
      features - the features to use for writing
    • getFieldWriter

      public final FieldWriter getFieldWriter(long hashCode)
      Description copied from interface: ObjectWriter
      Gets the FieldWriter for the specified field hash code.
      Specified by:
      getFieldWriter in interface ObjectWriter<T>
      Overrides:
      getFieldWriter in class ObjectWriterAdapter<T>
      Parameters:
      hashCode - the hash code of the field name
      Returns:
      the FieldWriter for the field, or null if not found