*
* @return JSON string
*/
public String modelToJson(final Object model, int maxDepth){
StringBuilder b = new StringBuilder();
JsonWriter w = new JsonWriter(b, new ModelWriter() {
public void write(JsonWriter writer, Object model, int maxDepth,
int currentDepth) {
invokeModelToJson(
Datastore.getModelMeta(model.getClass()),
writer, model, maxDepth, currentDepth + 1);