Code example for Gson

Methods: fromJson

0
    public static Item fromJSON(String json) {
 
		Item node;
		Gson gson = GsonUtil.getSubtreeGson();
		 
		node = gson.fromJson(json, Item.class);
		if (node.getId() == null) {
			node.setId(IdGenerator.generate());
		} 
		return node;
	} 
}