@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));
}
}
return out;
}