示例#1
0
 protected <T extends RestModel> T filterModel(
     Class<T> modelIface, T unfilteredModel, JsonFilter filter) throws Exception {
   JSONObject unfilteredJson =
       (JSONObject)
           JsonUtil.getJsonObject(unfilteredModel, false); // don't hide confidential properties
   JSONObject filteredJson = filter.trim(unfilteredJson);
   T filteredModel = getTypedModel(modelIface, filteredJson);
   filteredModel
       .trimmed(); // TBD - remove once the conversion to the new REST style guide is completed
   return filteredModel;
 }
示例#2
0
 protected JSONObject getJsonModel(RestModel typedModel) throws Exception {
   return (JSONObject)
       JsonUtil.getJsonObject(typedModel, false); // include confidential properties
 }