Java Code Examples for io.vertx.core.json.JsonArray#encode()

The following examples show how to use io.vertx.core.json.JsonArray#encode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OutStream.java    From raml-module-builder with Apache License 2.0 5 votes vote down vote up
public OutStream(RowSet<Row> result) {
  JsonArray ar = new JsonArray();
  RowIterator<Row> it = result.iterator();
  while (it.hasNext()) {
    Row row = it.next();
    JsonObject o = new JsonObject();
    for (int i = 0; i < row.size(); i++) {
      o.put(row.getColumnName(i), row.getValue(i));
    }
    ar.add(o);
  }
  data = ar.encode();
}
 
Example 2
Source File: JsonArrayConverter.java    From vertx-jooq with MIT License 4 votes vote down vote up
@Override
public String to(JsonArray userObject) {
    return userObject==null?null:userObject.encode();
}
 
Example 3
Source File: ObjectToJsonArrayBinding.java    From vertx-jooq with MIT License 4 votes vote down vote up
@Override
public Object to(JsonArray u) {
    return u == null ? null : u.encode();
}
 
Example 4
Source File: JsArray.java    From vertx-codetrans with Apache License 2.0 4 votes vote down vote up
@CodeTranslate
public void encode() throws Exception {
  JsonArray arr = new JsonArray().add("foo").add("bar");
  JsonTest.o = arr.encode();
}