Package buri.ddmsence

Examples of buri.ddmsence.AbstractAttributeGroup


   */
  public static void addNonEmptyJsonProperty(JsonObject object, String name, Object value) {
    if (value == null)
      return;
    if (value instanceof AbstractAttributeGroup) {
      AbstractAttributeGroup castValue = (AbstractAttributeGroup) value;
      if (!castValue.isEmpty()) {
        if (Boolean.valueOf(PropertyReader.getProperty("output.json.inlineAttributes"))) {
          JsonObject enclosure = castValue.getJSONObject();
          for (Entry<String, JsonElement> entry : enclosure.entrySet()) {
            object.add(entry.getKey(), entry.getValue());
          }
        }
        else {
          object.add(name, castValue.getJSONObject());
        }
      }
    }
    else if (value instanceof Boolean) {
      Boolean castValue = (Boolean) value;
      object.addProperty(name, castValue);
    }
    else if (value instanceof Double) {
      Double castValue = (Double) value;
      object.addProperty(name, castValue);
    }
    else if (value instanceof Integer) {
      Integer castValue = (Integer) value;
      object.addProperty(name, castValue);
    }
    else if (value instanceof JsonArray) {
      JsonArray castValue = (JsonArray) value;
      if (castValue.size() != 0)
        object.add(name, castValue);
    }
    else if (value instanceof JsonObject) {
      JsonObject castValue = (JsonObject) value;
      object.add(name, castValue);
View Full Code Here

TOP

Related Classes of buri.ddmsence.AbstractAttributeGroup

Copyright © 2018 www.massapicom. 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.