本文整理了Java中org.activityinfo.json.Json.createObject()
方法的一些代码示例,展示了Json.createObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.createObject()
方法的具体详情如下:
包路径:org.activityinfo.json.Json
类名称:Json
方法名:createObject
暂无
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("databaseId", databaseId);
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("downloadUrl", downloadUrl);
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("filter", filter);
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("filter", filter);
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
public static JsonValue fromEmbeddedEntity(EmbeddedEntity entity) {
JsonValue record = Json.createObject();
for (Map.Entry<String, Object> entry : entity.getProperties().entrySet()) {
if(entry.getValue() != null) {
record.add(entry.getKey(), fromPropertyValue(entry.getValue()));
}
}
return record;
}
代码示例来源:origin: bedatadriven/activityinfo
public JsonValue getChangedFieldValuesObject() {
JsonValue object = Json.createObject();
for (Map.Entry<ResourceId, FieldValue> entry : changedFieldValues.entrySet()) {
object.put(entry.getKey().asString(), entry.getValue().toJson());
}
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("rootFormId", rootFormId.asString());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@JsOverlay
public void setField(String fieldName, JsonValue value) {
if(fields == null) {
fields = Json.createObject();
}
fields.put(fieldName, value);
}
代码示例来源:origin: bedatadriven/activityinfo
@JsOverlay
public void setFieldValue(String fieldId, JsonValue value) {
if(fields == null) {
fields = Json.createObject();
}
fields.put(fieldId, value);
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("blobId", blobId);
object.put("bbox", envelope.toJsonElement());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("start", startDate.toString());
object.put("end", endDate.toString());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("model", tableModel.toJson());
object.put("format", format.name());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
public JsonValue toJsonElement() {
JsonValue object = createObject();
object.put("mimeType", mimeType);
object.put("width", width);
object.put("height", height);
object.put("filename", filename);
object.put("blobId", blobId);
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Test(expected = InvalidUpdateException.class)
public void newResourceWithInvalidClass() {
JsonValue change = createObject();
change.put("recordId", "XYZ123");
change.put("formId", createObject());
JsonValue changes = Json.createArray();
changes.add(change);
JsonValue updateObject = createObject();
updateObject.put("changes", changes);
updater.execute(updateObject);
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJsonObject() {
JsonValue object = createObject();
object.put("id", id.asString());
object.put("label", label);
object.put("type", "section");
object.put("elements", FormClass.toJsonArray(elements));
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("id", id.asString());
object.put("label", label);
object.put("resourceId", resourceId.asString());
object.put("dateRange", dateRange.toJson());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Test(expected = InvalidUpdateException.class)
public void invalidChangesProperty() {
JsonValue updateObject = createObject();
updateObject.put("changes", 42);
updater.execute(updateObject);
}
代码示例来源:origin: bedatadriven/activityinfo
@Test(expected = InvalidUpdateException.class)
public void newResourceWithMissingCollection() {
JsonValue change = createObject();
change.put("recordId", "XYZ123");
change.put("formId", "foobar");
JsonValue changes = Json.createArray();
changes.add(change);
JsonValue updateObject = createObject();
updateObject.put("changes", changes);
updater.execute(updateObject);
}
代码示例来源:origin: bedatadriven/activityinfo
public void testSetStringNull() {
JsonValue object = Json.createObject();
object.put("foo", (String)null);
assertTrue(object.get("foo").isJsonNull());
}
代码示例来源:origin: bedatadriven/activityinfo
public void testNative() {
JsonValue obj = Json.createObject();
obj.put("x", 42);
Object nativeObj = obj.toNative();
JsonValue result = nativeMethod(nativeObj);
assertEquals(43.0, result.get("y").asNumber());
}
内容来源于网络,如有侵权,请联系作者删除!