Package com.fasterxml.jackson.databind

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


    if (r.getStatus() >= 400) {
      throw new AccessTokenException(r.toString());
    } else {
      final JsonNode result = r.asJson();
      Logger.debug(result.asText());
      return new FoursquareAuthInfo(result.get(
          OAuth2AuthProvider.Constants.ACCESS_TOKEN).asText());
    }
  }
View Full Code Here


    if (node.has(Constants.Employment.IS_CURRENT)) {
      isCurrent = node.get(Constants.Employment.IS_CURRENT).asBoolean();
    }
    if ((childNode = LinkedinAuthUser.traverse(node,
        Constants.Employment.COMPANY_NAME)) != null) {
      companyName = childNode.asText();
    }
    return new EmploymentInfo(id, title, summary, startDateMonth,
        startDateYear, endDateMonth, endDateYear, isCurrent,
        companyName);
  }
View Full Code Here

    final OAuthCalculator op = getOAuthCalculator(info);

    final JsonNode userJson = signedOauthGet(userInfoUrl, op);
    final JsonNode emailJson = signedOauthGet(emailUrl, op);

    return new LinkedinAuthUser(userJson, emailJson.asText(), info);
  }

  @Override
  protected LinkedinAuthInfo buildInfo(final RequestToken requestToken)
      throws AccessTokenException {
View Full Code Here

            throws AccessTokenException {
        if (r.getStatus() >= 400) {
            throw new AccessTokenException(r.toString());
        } else {
            final JsonNode result = r.asJson();
            Logger.debug(result.asText());
            return new EventBriteAuthInfo(result.get(
                    OAuth2AuthProvider.Constants.ACCESS_TOKEN).asText());
        }
    }
}
View Full Code Here

      final ObjectCodec oc = jp.getCodec();
      final JsonNode openOrdersNode = oc.readTree(jp);

      final JsonNode errorNode = openOrdersNode.path("error");
      if (!errorNode.isMissingNode()) {
        final String errorText = errorNode.asText();
        if (errorText.equals("Invalid symbols pair")) {
          return new CexIOOpenOrders();
        }
        else {
          throw new ExchangeException("Unable to retrieve open orders because " + errorText);
View Full Code Here

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

      final ObjectCodec oc = jsonParser.getCodec();
      final JsonNode node = oc.readTree(jsonParser);
      final String orderType = node.asText();
      return CryptoTradeOrderType.valueOf(orderType);
    }
  }
}
View Full Code Here

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

      final ObjectCodec oc = jsonParser.getCodec();
      final JsonNode node = oc.readTree(jsonParser);
      final String orderType = node.asText();
      return BTEROrderType.valueOf(orderType.toUpperCase());
    }
  }
}
View Full Code Here

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      if (node.get("error") != null) {
        return new BitstampDepositAddress(node.path("error").asText(), "");
      }
      return new BitstampDepositAddress(null, node.asText());
    }
  }
}
View Full Code Here

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

    final ObjectCodec oc = jsonParser.getCodec();
    final JsonNode node = oc.readTree(jsonParser);
    final String currencyPairString = node.asText();

    return getCurrencyPairFromString(currencyPairString);
  }

  public static CurrencyPair getCurrencyPairFromString(String currencyPairString) {
View Full Code Here

                } else if (value.isDouble()) {
                    tree.setProperty(name, vf.createValue(value.asDouble()));
                } else if (value.isBigDecimal()) {
                    tree.setProperty(name, vf.createValue(value.decimalValue()));
                } else {
                    tree.setProperty(name, vf.createValue(value.asText()));
                }
            }
        }
    }
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.