Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonNode.asText()


  private void convertDeviceOwnerWebsite(final JsonNode obj) {
    final ObjectNode node = (ObjectNode) obj.path("DeviceOwner");
    final JsonNode current = node.path("Website");
    if (!current.isMissingNode() && !current.isNull()) {
      node.put("Website", this.createValueDatatype("uri", current.asText()));
    }
    if (current.isNull()) {
      node.remove("Website");
    }
  }
View Full Code Here


    if (!value.isTextual()) {
      throw new ParseException("Invalid property'" + OCCUR_PROPERTY + "': value is not textual");
    }

    try {
      final Occur occur = Occur.valueOf(value.asText());
      switch (occur) {
        case MUST:
          return Modifier.MOD_REQ;

        case SHOULD:
View Full Code Here

        case MUST_NOT:
          return Modifier.MOD_NOT;

        default:
          throw new ParseException("Invalid value '" + value.asText() + "' for property '" + OCCUR_PROPERTY + "'");
      }
    }
    catch (final IllegalArgumentException e) {
      throw new ParseException("Invalid value '" + value.asText() + "' for property '" + OCCUR_PROPERTY + "'", e);
    }
View Full Code Here

        default:
          throw new ParseException("Invalid value '" + value.asText() + "' for property '" + OCCUR_PROPERTY + "'");
      }
    }
    catch (final IllegalArgumentException e) {
      throw new ParseException("Invalid value '" + value.asText() + "' for property '" + OCCUR_PROPERTY + "'", e);
    }
  }

}
View Full Code Here

    if (!value.isTextual()) {
      throw new ParseException("Invalid property '" + this.getProperty() + "': value is not textual");
    }

    return value.asText();
  }

}
View Full Code Here

        this.url = json.path("url").asText();
        this.place = json.path("place").asText();
        this.address = json.path("address").asText();
        this.description = json.get("description").asText();
        JsonNode hashTagProp = json.path("hashTag");
        this.hashTag = hashTagProp.isNull() ? null : hashTagProp.asText();
        this.ownerId = json.get("ownerId").asText();
        this.foreImageId = Strings.emptyToNull(json.path("foreImageId").asText());
        this.backImageId = Strings.emptyToNull(json.path("backImageId").asText());
        JsonNode passcodeProp = json.path("passcode");
        this.passcode = passcodeProp.isNull() ? null : passcodeProp.asText();
View Full Code Here

        this.hashTag = hashTagProp.isNull() ? null : hashTagProp.asText();
        this.ownerId = json.get("ownerId").asText();
        this.foreImageId = Strings.emptyToNull(json.path("foreImageId").asText());
        this.backImageId = Strings.emptyToNull(json.path("backImageId").asText());
        JsonNode passcodeProp = json.path("passcode");
        this.passcode = passcodeProp.isNull() ? null : passcodeProp.asText();
        this.draft = json.path("draft").asBoolean(false);
        {
            JsonNode ar = json.get("editorIds");
            if (ar != null) {
                this.editorIds = new ArrayList<String>();
View Full Code Here

      name = iter.next();
      JsonNode child = node.get(name);
      if (child.isContainerNode()) {
        processNode(child, path.isEmpty() ? name : path + '.' + name, mapProperties);
      } else {
        mapProperties.put(PropertyHelper.getPropertyId(path, name), child.asText());
      }
    }
  }

  private String ensureArrayFormat(String s) {
View Full Code Here

        {
            String fieldName = fieldNames.next();
            JsonNode fieldNode = parent.get(fieldName);
            if (fieldName.equals(ID))
            {
                idAsString = fieldNode.asText();
            }
            else if (fieldName.equals(TYPE))
            {
                type = fieldNode.asText();
            }
View Full Code Here

            {
                idAsString = fieldNode.asText();
            }
            else if (fieldName.equals(TYPE))
            {
                type = fieldNode.asText();
            }
            else if (fieldNode.isArray())
            {
                // array containing either broker children or attribute values
                Iterator<JsonNode> elements = fieldNode.getElements();
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.