Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MenuObj {
- String id = "";
- String name = "";
- String description = "";
- String fixedPrice = "0.00";
- ArrayList<IngredientObj> children = new ArrayList<IngredientObj>();
- }
- public class IngredientObj {
- String id = "";
- String name = "";
- String description = "";
- }
- // in RestClass
- private void getMenuData(String result) {
- Log.e(TAG, "getMenuData NEW");
- System.out.println(result);
- ObjectMapper mapper = new ObjectMapper();
- try {
- MenuObj[] menuList = mapper.readValue(result, MenuObj[].class);
- for(MenuObj menu : menuList){
- System.out.println("menu.id: "+menu.id);
- for(IngredientObj ingr : menu.children){
- System.out.println("Ingredient: "+ingr.toString());
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment