public class AwtCodec extends Object implements ObjectSerializer, ObjectDeserializer
| Constructor and Description |
|---|
AwtCodec() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserialze(DefaultJSONParser parser,
Type type,
Object fieldName)
fastjson invokes this call-back method during deserialization when it encounters a field of the
specified type.
|
int |
getFastMatchToken() |
protected Color |
parseColor(DefaultJSONParser parser) |
protected Font |
parseFont(DefaultJSONParser parser) |
protected Point |
parsePoint(DefaultJSONParser parser,
Object fieldName) |
protected Rectangle |
parseRectangle(DefaultJSONParser parser) |
static boolean |
support(Class<?> clazz) |
void |
write(JSONSerializer serializer,
Object object,
Object fieldName,
Type fieldType,
int features)
fastjson invokes this call-back method during serialization when it encounters a field of the
specified type.
|
protected char |
writeClassName(SerializeWriter out,
Class<?> clazz,
char sep) |
public static final AwtCodec instance
public static boolean support(Class<?> clazz)
public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException
ObjectSerializerwrite in interface ObjectSerializerobject - src the object that needs to be converted to Json.fieldName - parent object field namefieldType - parent object field typefeatures - parent object field serializer featuresIOExceptionprotected char writeClassName(SerializeWriter out, Class<?> clazz, char sep)
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName)
ObjectDeserializerIn the implementation of this call-back method, you should consider invoking
JSON.parseObject(String, Type, Feature[]) method to create objects
for any non-trivial field of the returned object.
deserialze in interface ObjectDeserializerparser - context DefaultJSONParser being deserializedtype - The type of the Object to deserialize tofieldName - parent object field nameTprotected Font parseFont(DefaultJSONParser parser)
protected Color parseColor(DefaultJSONParser parser)
protected Rectangle parseRectangle(DefaultJSONParser parser)
protected Point parsePoint(DefaultJSONParser parser, Object fieldName)
public int getFastMatchToken()
getFastMatchToken in interface ObjectDeserializerCopyright © 2023. All rights reserved.