com.alibaba.fastjson.support.moneta

Class MonetaCodec

    • Field Detail

    • Constructor Detail

      • MonetaCodec

        public MonetaCodec()
    • Method Detail

      • write

        public void write(JSONSerializer serializer,
                          Object object,
                          Object fieldName,
                          Type fieldType,
                          int features)
                   throws IOException
        Description copied from interface: ObjectSerializer
        fastjson invokes this call-back method during serialization when it encounters a field of the specified type.
        Specified by:
        write in interface  ObjectSerializer
        object - src the object that needs to be converted to Json.
        fieldName - parent object field name
        fieldType - parent object field type
        features - parent object field serializer features
        Throws:
        IOException
      • deserialze

        public <T> T deserialze(DefaultJSONParser parser,
                                Type type,
                                Object fieldName)
        Description copied from interface: ObjectDeserializer
        fastjson invokes this call-back method during deserialization when it encounters a field of the specified type.

        In 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.

        Specified by:
        deserialze in interface  ObjectDeserializer
        Parameters:
        parser - context DefaultJSONParser being deserialized
        type - The type of the Object to deserialize to
        fieldName - parent object field name
        Returns:
        a deserialized object of the specified type which is a subclass of T

Copyright © 2012–2021 Alibaba Group. All rights reserved.