Class ObjectWriterImplMap

java.lang.Object
com.alibaba.fastjson2.writer.ObjectWriterPrimitiveImpl
com.alibaba.fastjson2.writer.ObjectWriterImplMap
All Implemented Interfaces:
ObjectWriter

public final class ObjectWriterImplMap extends ObjectWriterPrimitiveImpl
  • Constructor Details

    • ObjectWriterImplMap

      public ObjectWriterImplMap(Class objectClass, long features)
    • ObjectWriterImplMap

      public ObjectWriterImplMap(Type keyType, Type valueType, Class objectClass, Type objectType, long features)
    • ObjectWriterImplMap

      public ObjectWriterImplMap(Type keyType, Type valueType, String format, Class objectClass, Type objectType, long features)
  • Method Details

    • of

      public static ObjectWriterImplMap of(Class objectClass)
    • of

      public static ObjectWriterImplMap of(Type type)
    • of

      public static ObjectWriterImplMap of(Type type, Class defineClass)
    • of

      public static ObjectWriterImplMap of(Type type, String format, Class defineClass)
    • writeArrayMappingJSONB

      public void writeArrayMappingJSONB(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features)
      Description copied from interface: ObjectWriter
      Writes an object to the JSONWriter in array mapping JSONB format with additional parameters.
      Specified by:
      writeArrayMappingJSONB in interface ObjectWriter
      Overrides:
      writeArrayMappingJSONB in class ObjectWriterPrimitiveImpl
      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
    • writeJSONB

      public void writeJSONB(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features)
      Description copied from interface: ObjectWriter
      Writes an object to the JSONWriter in JSONB format.
      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
    • writeTypeInfo

      public boolean writeTypeInfo(JSONWriter jsonWriter)
      Description copied from interface: ObjectWriter
      Writes type information to the JSON output. This is used for polymorphic serialization to include type information in the JSON output.
      Parameters:
      jsonWriter - the JSONWriter to which type information should be written
      Returns:
      true if type information was written, false otherwise
    • 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.
      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
    • writeWithFilter

      public void writeWithFilter(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features)
      Description copied from interface: ObjectWriter
      Writes an object to the JSONWriter with filter support.
      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