use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class ExportFormJob method toJson.
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("model", tableModel.toJson());
return object;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class FormClassTest method parseResource.
private FormClass parseResource() throws IOException {
URL resource = Resources.getResource(FormClass.class, "OldFormClass1.json");
String json = Resources.toString(resource, Charsets.UTF_8);
JsonParser parser = new org.activityinfo.json.JsonParser();
JsonValue element = parser.parse(json);
return FormClass.fromJson(element);
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class EnumItem method toJsonObject.
public JsonValue toJsonObject() {
JsonValue jsonObject = createObject();
jsonObject.put("id", id.asString());
jsonObject.put("label", label);
if (!Strings.isNullOrEmpty(code)) {
jsonObject.put("code", code);
}
return jsonObject;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class EnumType method getParametersAsJson.
@Override
public JsonValue getParametersAsJson() {
JsonValue enumValueArray = Json.createArray();
for (EnumItem enumItem : getValues()) {
enumValueArray.add(enumItem.toJsonObject());
}
JsonValue object = createObject();
object.put("cardinality", cardinality.name().toLowerCase());
object.put("presentation", presentation.name().toLowerCase());
object.put("values", enumValueArray);
return object;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class GeoArea method toJson.
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("blobId", blobId);
object.put("bbox", envelope.toJsonElement());
return object;
}
Aggregations