Berfy / google-gson

Automatically exported from code.google.com/p/google-gson
1 stars 0 forks source link

Serialization and Deserialization of Type and Class #340

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a class like 

Class Function {

public int functionId;
public Type functionId;
public String functionName

}

public void static main ()
{
                Function fc= new Function();        
        fc.functionId(100);
        fc.functionName("Divide");

        Type tmp = new Integer(100).getClass();
        Gson gson = new GsonBuilder.create();
        System.out.println(gson.togson(fc) );
}

I am getting {} ie null for functionType Filed.
What is the issue here ? am I missing something

Original issue reported on code.google.com by DRDO.YOG...@gmail.com on 1 Jul 2011 at 5:23