@Override public String process(Entity entity, MetaClass metaclass, View view) throws Exception { MyJSONObject jsonObject = encodeInstance(entity, new HashSet<Entity>(), metaclass, view); return jsonObject.toString(); }
protected MyJSONObject _process(Entity entity) throws Exception { return encodeInstance(entity, new HashSet<Entity>(), entity.getMetaClass(), null); }
protected MyJSONObject.Array _process(List<Entity> entities, MetaClass metaClass, View view) throws Exception { MyJSONObject.Array result = new MyJSONObject.Array(); for (Entity entity : entities) { MyJSON item = encodeInstance(entity, new HashSet<Entity>(), metaClass, view); result.add(item); } return result; }
@Override public String process(Set<Entity> entities) throws Exception { MyJSONObject.Array result = new MyJSONObject.Array(); for (Entity entity : entities) { MyJSONObject entityJson = encodeInstance(entity, new HashSet<Entity>(), getMetaClass(entity), null); if (restConfig.getRestApiVersion() == 1) { //return map for old version of rest api MyJSONObject valueJson = encodeInstance(entity, new HashSet<Entity>(), getMetaClass(entity), null); MyJSONObject.Array mapping = new MyJSONObject.Array(); mapping.add(entityJson); mapping.add(valueJson); result.add(mapping); } else { result.add(entityJson); } } return result.toString(); }
root.set(property.getName(), null); } else { root.set(property.getName(), encodeInstance((Entity) value, visited, property.getRange().asClass(), propertyView)); array.add(null); } else { array.add(encodeInstance((Entity) o, visited, property.getRange().asClass(), propertyView));