Package server.serialization

Source Code of server.serialization.JSONSerialization

package server.serialization;

import flexjson.JSONDeserializer;
import flexjson.JSONSerializer;
import util.Log;

/**
*
* @author Eldred
*/
public class JSONSerialization extends GenericSerializer
{
    @Override
    public Object unserializeObject(String json)
    {
        JSONDeserializer D = new JSONDeserializer();
       
        return D.deserialize(json);
    }
   
    @Override
    public String serializeObject(Object o)
    {
        JSONSerializer S = new JSONSerializer().include("*").exclude("class");
       
        Log.log("Serialized obj : " + S.deepSerialize(o));
       
        return S.deepSerialize(o);
    }

}
TOP

Related Classes of server.serialization.JSONSerialization

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.