if( !(o instanceof Role) ) {
throw new SerializationException("RoleJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
}
try {
Role role = (Role)o;
result = new JSONObject();
result.put(ROLE_ID, role.getId() );
result.put(ROLE_NAME, role.getName() );
result.put(ROLE_DESCRIPTION, role.getDescription() );
result.put(ROLE_CODE, role.getCode() );
result.put(ROLE_TYPE_ID, role.getRoleTypeID() );
result.put(ROLE_TYPE_CD, role.getRoleTypeCD() );
result.put(SAVE_PERSONAL_FOLDER, role.isAbleToSaveIntoPersonalFolder() );
result.put(SAVE_META, role.isAbleToSaveMetadata());
result.put(SAVE_REMEMBER, role.isAbleToSaveRememberMe() );
result.put(SAVE_SUBOBJ, role.isAbleToSaveSubobjects() );
result.put(SEE_META, role.isAbleToSeeMetadata() );
result.put(SEE_NOTES, role.isAbleToSeeNotes() );
result.put(SEE_SNAPSHOT, role.isAbleToSeeSnapshots() );
result.put(SEE_SUBOBJ, role.isAbleToSeeSubobjects() );
result.put(SEE_VIEWPOINTS, role.isAbleToSeeViewpoints() );
result.put(SEND_MAIL, role.isAbleToSendMail() );
result.put(BUILD_QBE, role.isAbleToBuildQbeQuery() );
result.put(DEFAULT_ROLE, role.isDefaultRole() );
} catch (Throwable t) {
throw new SerializationException("An error occurred while serializing object: " + o, t);
} finally {