Examples of textValue()


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

        public Edge edgeFromJson(final JsonNode json, final Vertex out, final Vertex in) throws IOException {
            final Map<String, Object> props = GraphSONUtility.readProperties(json);

            final Object edgeId = getTypedValueFromJsonNode(json.get(GraphSONTokens._ID));
            final JsonNode nodeLabel = json.get(GraphSONTokens._LABEL);
            final String label = nodeLabel == null ? EMPTY_STRING : nodeLabel.textValue();

            final Edge e = out.addEdge(label, in, T.id, edgeId);
            for (Map.Entry<String, Object> entry : props.entrySet()) {
                e.property(entry.getKey(), entry.getValue());
            }
View Full Code Here

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

            case NUMBER:
                return fieldNode.numberValue();
            case STRING:
                try {
                    return NumberFormat.getInstance(Locale.getDefault()).parse(
                        fieldNode.textValue());
                } catch (final ParseException e) {
                    throw new JsonDeserializationException(
                            JsonDeserializationExceptionCode.invalidFieldValue, e,
                            fieldName, getTextualBeanType(), e.getMessage());
                }
View Full Code Here

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

        switch (fieldNode.getNodeType()) {
            case BOOLEAN:
                return fieldNode.booleanValue();
            case STRING:
                return Boolean.valueOf(
                        fieldNode.textValue());
            default:
                throw new JsonDeserializationException(
                        JsonDeserializationExceptionCode.invalidFieldValue,
                        fieldName, getTextualBeanType(), "Field cannot be read as a boolean");
        }
View Full Code Here

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) {
View Full Code Here

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 JsonDeserializationException(
View Full Code Here

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

     */
    public URL getNodeURLValue(final ObjectNode recordNode,
                                           final String fieldName) {
        final JsonNode addressNode = findFieldNode(recordNode, fieldName);
        try {
            if (addressNode.textValue() != null) {
                return getURLFromString(addressNode.textValue());
            } else {
                return null;
            }
        } catch (final Throwable e) {
View Full Code Here

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

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

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

                if (node.isNumber()) {
                    return node.numberValue();
                } else if (node.isBoolean()) {
                    return node.booleanValue();
                } else if (node.isTextual()) {
                    return node.textValue();
                } else {
                    return node;
                }
            }
        }
View Full Code Here

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

    @Override
    public LedgerType deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      String ledgerTypeString = node.textValue();
      return fromString(ledgerTypeString);
    }

  }
}
View Full Code Here

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

    @Override
    public KrakenOrderStatus deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      String orderStatusString = node.textValue();
      return fromString(orderStatusString);
    }
  }
}
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.