How do you handle generic maps ( that can be nested) while fetching json from server with a simple generic Entity interface

18 views
Skip to first unread message

Debasish Padhy

unread,
Dec 1, 2014, 5:40:00 AM12/1/14
to gwtq...@googlegroups.com
I want to have a simple generic Entity interface pretty much like a map 

such as 


public interface Entity extends JsonBuilder {

   
public String JsonObject getProperty(String property) ;

   
public Entity setProperty(String name , JsonObject obj ) ;

   
public String getPropertyType(String property) /* returns the actual
   
}

I want to be able to convert any pojo on server side to a Map form along with some type info and retrieve it on client as an Entity. 

Is this doable ? If yes. Please give some detailed guidelines. 


Please feel free to respond there if you use SO. 

thanks a ton. 

Debasish Padhy

unread,
Dec 1, 2014, 11:10:32 AM12/1/14
to gwtq...@googlegroups.com
Do you think this will serve my purpose ? If yes - how will the underlying json string look like ?


        public interface Tuple extends JsonBuilder {

               public JsonValue get(String name);

               public void set(String name, JsonValue ser);

       }

       public interface Entity extends Tuple {

               public String getType();

               public Tuple[] getTuples();

       }

Reply all
Reply to author
Forward
0 new messages