Package com.sdicons.json.model

Examples of com.sdicons.json.model.JSONObject


    }

    @Override
    public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
  if (aValue.isObject()) {
      final JSONObject jsonObject = (JSONObject) aValue;
      final AjLegoBox out = new AjLegoBox();
      out.setAvgRating(Helper.getIntRequired(jsonObject, "avgRating",
        "AjLegoBox property avgRating was not found in json data"));
      out.setBoxNo(Helper.getStringRequired(jsonObject, "boxNo",
        "AjLegoBox property boxNo was not found in json data"));
View Full Code Here


    }

    @Override
    public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
  if (aValue.isObject()) {
      final JSONObject jsonObject = (JSONObject) aValue;
      final AjPageable out = new AjPageable();
      out.setAsc(Helper.getBooleanRequired(jsonObject, "asc",
        "AjPageable property asc was not found in json data"));
      out.setBase(Helper.getIntRequired(jsonObject, "base",
        "AjPageable property base was not found in json data"));
      out.setCurrentPageNo(Helper.getIntRequired(jsonObject, "currentPageNo",
        "AjPageable property currentPageNo was not found in json data"));
      out.setOrderBy(Helper.getStringRequired(jsonObject, "orderBy",
        "AjPageable property orderBy was not found in json data"));
      out.setRowCount(Helper.getIntRequired(jsonObject, "rowCount",
        "AjPageable property rowCount was not found in json data"));
      out.setRowPerPage(Helper.getIntRequired(jsonObject, "rowPerPage",
        "AjPageable property rowPerPage was not found in json data"));
      JSONValue list = jsonObject.get("currentPage");
      if (list == null) {
    throw new MapperException(
      "AjPageable property currentPage was not found in json data");
      } else {
    out.setCurrentPage(new ArrayList<AjLegoBox>());
View Full Code Here

    }

    @Override
    public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
  if (aValue.isObject()) {
      JSONObject jsonObject = (JSONObject) aValue;
      // jsonObject.
      AjPropertiesParams out = new AjPropertiesParams();
      out.setYearRange((AjSelectionRange) JSONMapper.toJava(jsonObject.get("yearRange"),
        AjSelectionRange.class));
      out.setPriceRange((AjSelectionRange) JSONMapper.toJava(jsonObject.get("priceRange"),
        AjSelectionRange.class));
      out.setIdPropertyValues((List<Integer>) JSONMapper.toJava(
        jsonObject.get("idPropertyValues"), LinkedList.class));

      out.setIdPropertyValues(new ArrayList<Integer>());
      if (jsonObject.get("idPropertyValues") != null
        && jsonObject.get("idPropertyValues") instanceof JSONArray) {
    JSONArray array = (JSONArray) jsonObject.get("idPropertyValues");
    for (JSONValue jsonValue : array.getValue()) {
        out.getIdPropertyValues().add(
          (Integer) JSONMapper.toJava(jsonValue, Integer.class));
    }
      }
View Full Code Here

TOP

Related Classes of com.sdicons.json.model.JSONObject

Copyright © 2018 www.massapicom. 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.