@Override
public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
if (aValue.isObject()) {
final JSONObject jsonObject = (JSONObject) aValue;
final AjUser out = new AjUser();
out.setIdUser(Helper.getIntRequired(jsonObject, "idUser",
"AjUser property idUser was not found in json data"));
out.setIdImageIcon(Helper.getIntRequired(jsonObject, "idImageIcon",
"AjUser property IdImageIcon was not found in json data"));
out.setBirthDate(Helper.getDate(jsonObject, "birthDate"));
out.setUserName(Helper.getStringRequired(jsonObject, "userName",
"AjUser property userName was not found in json data"));
out.setEmail(Helper.getStringRequired(jsonObject, "email",
"AjUser property email was not found in json data"));
out.setIdBlog(Helper.getIntRequired(jsonObject, "idBlog",
"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());
}