Package com.alibaba.fastjson2.writer
Class ObjectWriter1<T>
java.lang.Object
com.alibaba.fastjson2.writer.ObjectWriterAdapter<T>
com.alibaba.fastjson2.writer.ObjectWriter1<T>
- All Implemented Interfaces:
ObjectWriter<T>
-
Field Summary
FieldsFields inherited from class com.alibaba.fastjson2.writer.ObjectWriterAdapter
fieldWriterArray, typeName, typeNameHash, typeNameJSONB, typeNameSymbolCache -
Constructor Summary
ConstructorsConstructorDescriptionObjectWriter1(Class<T> objectClass, String typeKey, String typeName, long features, List<FieldWriter> fieldWriters) -
Method Summary
Modifier and TypeMethodDescriptionfinal FieldWritergetFieldWriter(long hashCode) Gets the FieldWriter for the specified field hash code.voidwrite(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) Writes an object to the JSONWriter with the given field name, field type, and features.Methods inherited from class com.alibaba.fastjson2.writer.ObjectWriterAdapter
errorOnNoneSerializable, getFeatures, getFieldWriters, hasFilter, hasFilter0, setNameFilter, setPropertyFilter, setPropertyPreFilter, setValueFilter, toJSONObject, toJSONObject, toMap, toString, writeArrayMappingJSONB, writeClassInfo, writeJSONB, writeTypeInfo, writeWithFilterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.alibaba.fastjson2.writer.ObjectWriter
getFieldValue, getFieldWriter, setFilter, toJSONString, write, writeArrayMapping, writeArrayMappingJSONB, writeWithFilter
-
Field Details
-
fieldWriter0
-
-
Constructor Details
-
ObjectWriter1
-
-
Method Details
-
write
public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) Description copied from interface:ObjectWriterWrites an object to the JSONWriter with the given field name, field type, and features.- Specified by:
writein interfaceObjectWriter<T>- Overrides:
writein classObjectWriterAdapter<T>- Parameters:
jsonWriter- the JSONWriter to which the object should be writtenobject- the object to writefieldName- the name of the field being writtenfieldType- the type of the field being writtenfeatures- the features to use for writing
-
getFieldWriter
Description copied from interface:ObjectWriterGets the FieldWriter for the specified field hash code.- Specified by:
getFieldWriterin interfaceObjectWriter<T>- Overrides:
getFieldWriterin classObjectWriterAdapter<T>- Parameters:
hashCode- the hash code of the field name- Returns:
- the FieldWriter for the field, or null if not found
-