if (value != null) {
JsonBuilder selection = new JsonBuilder();
try {
selection.object();
getProvider().toJson(value, selection);
selection.endObject();
} catch (JSONException e) {
throw new RuntimeException("Error converting model object to Json", e);
}