Пример #1
0
 @CodeTranslate
 public void putBooleanFromIdentifier() throws Exception {
   JsonObject obj = new JsonObject();
   obj.put("_true", true);
   obj.put("_false", false);
   JsonTest.o = JsonConverter.toJsonObject(obj);
 }
Пример #2
0
 @CodeTranslate
 public void putObjectFromConstructor() throws Exception {
   JsonObject obj = new JsonObject().put("nested", new JsonObject().put("foo", "bar"));
   JsonTest.o = JsonConverter.toJsonObject(obj);
 }
Пример #3
0
 @CodeTranslate
 public void putNumberFromIdentifier() throws Exception {
   JsonObject obj = new JsonObject();
   obj.put("port", 8080);
   JsonTest.o = JsonConverter.toJsonObject(obj);
 }
Пример #4
0
 @CodeTranslate
 public void getArrayFromIdentifier() throws Exception {
   JsonObject obj = new JsonObject().put("nested", new JsonArray().add("foo"));
   JsonArray arr = obj.getJsonArray("nested");
   JsonTest.o = JsonConverter.toJsonArray(arr);
 }
Пример #5
0
 @CodeTranslate
 public void getJsonArray() {
   JsonObject obj = JsonTest.object;
   obj = JsonConverter.fromJsonObject(obj);
   JsonTest.o = obj.getJsonArray("foo").encodePrettily();
 }
Пример #6
0
 @CodeTranslate
 public void putStringFromIdentifier() throws Exception {
   JsonObject obj = new JsonObject();
   obj.put("foo", "foo_value");
   JsonTest.o = JsonConverter.toJsonObject(obj);
 }
Пример #7
0
 @CodeTranslate
 public void instantiate() throws Exception {
   JsonObject obj = new JsonObject();
   JsonTest.o = JsonConverter.toJsonObject(obj);
 }
Пример #8
0
 @CodeTranslate
 public void getObjectFromIdentifier() throws Exception {
   JsonObject obj = new JsonObject().put("nested", new JsonObject().put("foo", "bar"));
   JsonObject nested = obj.getJsonObject("nested");
   JsonTest.o = JsonConverter.toJsonObject(nested);
 }