Examples of textValue()


Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

  public InetAddress getNodeAddressValue(final ObjectNode recordNode,
      final String fieldName) {
    final JsonNode addressNode = findFieldNode(recordNode, fieldName);
    try {
      if (addressNode.textValue() != null) {
        return getAddressFromString(addressNode.textValue());
      } else {
        return null;
      }
    } catch (final Throwable e) {
      throw new DNSAPIClientJsonMappingException(
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

    public final JsonNode execute(JsonNode request, JsonCallback callback) throws CommandException {
        if (request == null) throw new CommandParsingException(NullNode.getInstance(),"Invalid request: null");
        JsonNode nameNode = request.get(ScriptCommand.NAME);

        if (nameNode != null && nameNode.isTextual()) {
            String name = nameNode.textValue();
            if (name==null || name.length()==0){
                throw new CommandParsingException(request,"Command name cannot be empty");
            }

            ScriptCommand command = commands().get(name);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

    public static JsonNode execute(JsonNode request, JsonCallback callback) throws CommandException {
        if (request == null) throw new CommandParsingException(NullNode.getInstance(),"command is null");
        JsonNode resourceNode = request.get(ScriptCommand.RESOURCE);
        if (resourceNode != null && resourceNode.isTextual()) {
            String name = resourceNode.textValue();
            if (name == null|| name.length()==0){
                throw new CommandParsingException(request,"Resource name cannot be empty");
            }
            Resource resource = RESOURCES.get(name);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

          }
       
          Record doc = new Record();
          JsonNode user = rootNode.get("user");
          JsonNode idNode = rootNode.get("id_str");
          if (idNode == null || idNode.textValue() == null) {
            continue; // skip
          }
     
          doc.put("id", idPrefix + idNode.textValue());
          tryAddDate(doc, "created_at", rootNode.get("created_at"));         
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

          JsonNode idNode = rootNode.get("id_str");
          if (idNode == null || idNode.textValue() == null) {
            continue; // skip
          }
     
          doc.put("id", idPrefix + idNode.textValue());
          tryAddDate(doc, "created_at", rootNode.get("created_at"));         
          tryAddString(doc, "source", rootNode.get("source"));
          tryAddString(doc, "text", rootNode.get("text"));
          tryAddInt(doc, "retweet_count", rootNode.get("retweet_count"));
          tryAddBool(doc, "retweeted", rootNode.get("retweeted"));
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

          }
       
          Record doc = new Record();
          JsonNode user = rootNode.get("user");
          JsonNode idNode = rootNode.get("id_str");
          if (idNode == null || idNode.textValue() == null) {
            continue; // skip
          }
     
          doc.put("id", idPrefix + idNode.textValue());
          tryAddDate(doc, "created_at", rootNode.get("created_at"));         
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

          JsonNode idNode = rootNode.get("id_str");
          if (idNode == null || idNode.textValue() == null) {
            continue; // skip
          }
     
          doc.put("id", idPrefix + idNode.textValue());
          tryAddDate(doc, "created_at", rootNode.get("created_at"));         
          tryAddString(doc, "source", rootNode.get("source"));
          tryAddString(doc, "text", rootNode.get("text"));
          tryAddInt(doc, "retweet_count", rootNode.get("retweet_count"));
          tryAddBool(doc, "retweeted", rootNode.get("retweeted"));
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

        final JsonNode nodeLabel = json.get(GraphSONTokens._LABEL);

        // assigned an empty string edge label in cases where one does not exist.  this gets around the requirement
        // that blueprints graphs have a non-null label while ensuring that GraphSON can stay flexible in parsing
        // partial bits from the JSON.  Not sure if there is any gotchas developing out of this.
        final String label = nodeLabel == null ? EMPTY_STRING : nodeLabel.textValue();

        final Edge e = factory.createEdge(edgeId, out, in, label);

        for (Map.Entry<String, Object> entry : props.entrySet()) {
            // if (this.edgePropertyKeys == null || this.edgePropertyKeys.contains(entry.getKey())) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

    if (recordTypeNode == null) {
      throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.missingField,
          TYPE_FIELD_NAME, "resource record");
    }
    final String recordType = recordTypeNode.textValue();
    final Class<? extends Record> recordClass = recordClassesRegistry
        .get(recordType);
    if (recordClass == null) {
      throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.unknownResourceRecordType,
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.textValue()

        return products;
    }

    private String getValue(JsonNode json, String key) {
        JsonNode node = json.get(key);
        return node != null ? node.textValue() : null;
    }

    private Map<String, String> getFlattenedProductAttributes(JsonNode poolJson) {
        Map<String, String> allAttributes = new HashMap<String, String>();
        if (poolJson.hasNonNull("productAttributes")) {
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.