Examples of JsonNull


Examples of com.google.gson.JsonNull

        }

        @Override
        public JsonElement serialize(List<PortConfig> src, Type typeOfSrc, JsonSerializationContext context) {
            if (src.size() == 0) {
                return new JsonNull();
            }
            JsonArray array = new JsonArray();
            for (PortConfig pc : src) {
                array.add(s_gson.toJsonTree(pc));
            }
View Full Code Here

Examples of com.google.gson.JsonNull

     * @return JsonElement with key/value(s) pairs or JsonNull if metadata is null.
     */
    @Override
    public JsonElement serialize(Metadata metadata, Type type, JsonSerializationContext context) {
        if (metadata == null){
            return new JsonNull();
        }
        String[] names = getNames(metadata);
        if (names == null) {
            return new JsonNull();
        }

        JsonObject root = new JsonObject();

        for (String n : names) {
View Full Code Here

Examples of com.google.gson.JsonNull

        return retval;
    }
   
    private JsonElement asJsonValue(Object value) {
        if (value == null) {
            return new JsonNull();
        } else if (value.getClass().isArray()) {
            Object[] arr = (Object[]) value;
            JsonArray retval = new JsonArray();
            for (Object sub : arr) {
                retval.add(asJsonValue(sub));
View Full Code Here

Examples of com.google.gson.JsonNull

                JsonSerializationContext context) {
            JsonObject obj = new JsonObject();
            obj.add("to", context.serialize(objref.getReferredName()));
            JsonElement js_attr;
            if (objref.getAttr() == null) {
                js_attr = new JsonNull();
            } else {
                js_attr = context.serialize(objref.getAttr());
            }
            obj.add("attr", js_attr);
            obj.addProperty("href", objref.getHRef());
View Full Code Here

Examples of org.sourceforge.jsonedit.core.outline.elements.JsonNull

   * @throws JsonReaderException
   * @throws JsonTextOutlineParserException
   */
  private void doJsonNull(String key, int start) throws JsonReaderException, JsonTextOutlineParserException, BadLocationException, BadPositionCategoryException  {
   
    JsonNull jsonNull = new JsonNull(parent, key);
    parent.addChild(jsonNull);
    jsonNull.setStart(start, doc);
   
    char ch = parser.getNextChar();
    if (ch != u) {
      JsonError jsonError = new JsonError(parent, "Expect null value");
      parent.addChild(jsonError);
      throw new JsonTextOutlineParserException();
    }
   
    ch = parser.getNextChar();
    if (ch != l) {
      JsonError jsonError = new JsonError(parent, "Expect null value");
      parent.addChild(jsonError);
      throw new JsonTextOutlineParserException();
    }
   
    ch = parser.getNextChar();
    if (ch != l) {
      JsonError jsonError = new JsonError(parent, "Expect null value");
      parent.addChild(jsonError);
      throw new JsonTextOutlineParserException();
    }
    jsonNull.setLength(parser.getPosition() - start + 1);
   
    ch = parser.getNextClean();
    if (isNotClosed(ch)) {
      JsonError jsonError = new JsonError(parent, "Expected end value");
      parent.addChild(jsonError);
      throw new JsonTextOutlineParserException();
    }
   
    jsonNull.setValue("null");
   
  }
View Full Code Here

Examples of se.llbit.json.JsonNull

      JsonArray array = new JsonArray();
      for (int i = 0; i < 6; ++i) {
        if (!skybox[i].isEmptyTexture()) {
          array.add(skyboxFileName[i]);
        } else {
          array.add(new JsonNull());
        }
      }
      sky.add("skybox", array);
      break;
    }
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.