Examples of MapperException


Examples of com.cognifide.slice.mapper.exception.MapperException

    } catch (Exception e) {
      String path = resource.getPath();
      String format = "[path={0}]: cannot map to object({1})";
      String message = MessageFormat.format(format, path, e.getMessage());
      logger.warn(message);
      throw new MapperException("mapResourceToObject failed", e);
    }
  }
View Full Code Here

Examples of com.cognifide.slice.mapper.exception.MapperException

    Object array = Array.newInstance(componentType, children.size());
    int index = 0;
    for (Object child : children) {
      if (!componentType.isAssignableFrom(child.getClass())) {
        String message = MessageFormat.format("Can't cast {0} into {1} array", child, componentType);
        throw new MapperException(message);
      }
      Array.set(array, index++, child);
    }
    return array;
  }
View Full Code Here

Examples of com.cognifide.slice.mapper.exception.MapperException

    } catch (Exception e) {
      String path = resource.getPath();
      String format = "[path={0}]: cannot map to object({1})";
      String message = MessageFormat.format(format, path, e.getMessage());
      logger.warn(message);
      throw new MapperException("mapResourceToObject failed", e);
    }
  }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

        "AjUser property idBlog was not found in json data"));
      out.setLastLogin(Helper.getDate(jsonObject, "lastLogin"));
      out.setRegistrationDate(Helper.getDate(jsonObject, "registrationDate"));
      return out;
  }
  throw new MapperException("AjPropertyValue cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

      lElements.getValue().put("lastLogin", JSONMapper.toJSON(user.getLastLogin()));
      lElements.getValue().put("registrationDate",
        JSONMapper.toJSON(user.getRegistrationDate()));
      return lElements;
  } else {
      throw new MapperException();
  }
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

      } else {
    out.setTo((Integer) JSONMapper.toJava(jsonObject.get("to"), Integer.class));
      }
      return out;
  }
  throw new MapperException("BooleanMapper cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

    out.getValues().add(
      (AjPropertyValue) JSONMapper.toJava(jsonValue, AjPropertyValue.class));
      }
      return out;
  }
  throw new MapperException("AjPropertyValue cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

        "AjPropertyValue property webName was not found in json data"));
      out.setCount(Helper.getIntRequired(jsonObject, "count",
        "AjPropertyValue property count was not found in json data"));
      return out;
  }
  throw new MapperException("AjPropertyValue cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

    static Integer getIntRequired(final JSONObject jsonObject, final String name,
      final String errorMessage) throws MapperException {
  final JSONValue fromJsonValue = jsonObject.get(name);
  if (fromJsonValue == null) {
      throw new MapperException(errorMessage);
  } else {
      return (Integer) JSONMapper.toJava(fromJsonValue, Integer.class);
  }
    }
View Full Code Here

Examples of com.sdicons.json.mapper.MapperException

    static String getStringRequired(final JSONObject jsonObject, final String name,
      final String errorMessage) throws MapperException {
  final JSONValue fromJsonValue = jsonObject.get(name);
  if (fromJsonValue == null) {
      throw new MapperException(errorMessage);
  } else {
      return (String) JSONMapper.toJava(fromJsonValue, String.class);
  }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.