@Override
public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
if (aValue.isObject()) {
final JSONObject jsonObject = (JSONObject) aValue;
final AjSelectionRange out = new AjSelectionRange();
final JSONValue fromJsonValue = jsonObject.get("from");
if (fromJsonValue == null) {
out.setFrom(-1);
} else {
out.setFrom((Integer) JSONMapper.toJava(fromJsonValue, Integer.class));
}
final JSONValue toJsonValue = jsonObject.get("to");
if (toJsonValue == null) {
out.setTo(Integer.MAX_VALUE);
} else {
out.setTo((Integer) JSONMapper.toJava(jsonObject.get("to"), Integer.class));
}