Package org.vertx.java.core.json

Examples of org.vertx.java.core.json.JsonArray.encode()


    public boolean put(K key, V value) {
      synchronized (map) {
        String sdata = map.get(key);
        JsonArray data = sdata != null ? new JsonArray(sdata) : new JsonArray();
        data.add(value);
        map.put(key, data.encode());
      }
      return true;
    }

    @Override
View Full Code Here


            } else {
              newData.add(item);
            }
          }
          if (newData.size() > 0) {
            map.put((K) key, newData.encode());
          } else {
            map.remove((K) key);
          }
          return true;
        }
View Full Code Here

    public void end(JsonElement json) {
        if (json.isArray()) {
            JsonArray jsonArray = json.asArray();
            setContentType("application/json", "UTF-8");
            end(jsonArray.encode());
        } else if (json.isObject()) {
            JsonObject jsonObject = json.asObject();
            setContentType("application/json", "UTF-8");
            end(jsonObject.encode());
        }
View Full Code Here

        String body = null;

        if (json != null) {
            if (json.isArray()) {
                JsonArray jsonArray = json.asArray();
                body = jsonArray.encode();
            } else if (json.isObject()) {
                JsonObject jsonObject = json.asObject();
                body = jsonObject.encode();
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.