Package com.fasterxml.jackson.databind

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


  @Override
  public Map<CurrencyPair, CryptoTradePair> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

    final ObjectCodec oc = jp.getCodec();
    final JsonNode rootNode = oc.readTree(jp);
    final ArrayNode currencyPairs = (ArrayNode) rootNode.path("currency_pairs");
    final ArrayNode securityPairs = (ArrayNode) rootNode.path("security_pairs");

    final Map<CurrencyPair, CryptoTradePair> pairs = new HashMap<CurrencyPair, CryptoTradePair>();
    for (JsonNode pairInfo : currencyPairs) {
      final CryptoTradePairType type = CryptoTradePairType.normal_pair;
View Full Code Here


  public Map<CurrencyPair, CryptoTradePair> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

    final ObjectCodec oc = jp.getCodec();
    final JsonNode rootNode = oc.readTree(jp);
    final ArrayNode currencyPairs = (ArrayNode) rootNode.path("currency_pairs");
    final ArrayNode securityPairs = (ArrayNode) rootNode.path("security_pairs");

    final Map<CurrencyPair, CryptoTradePair> pairs = new HashMap<CurrencyPair, CryptoTradePair>();
    for (JsonNode pairInfo : currencyPairs) {
      final CryptoTradePairType type = CryptoTradePairType.normal_pair;
      String label = pairInfo.fieldNames().next();
View Full Code Here

    @Override
    public CryptoTradePublicOrder deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      final ObjectCodec oc = jp.getCodec();
      final JsonNode node = oc.readTree(jp);
      final String priceString = node.path(0).asText();
      final String amountString = node.path(1).asText();

      return new CryptoTradePublicOrder(new BigDecimal(amountString), new BigDecimal(priceString));
    }
  }
View Full Code Here

    public CryptoTradePublicOrder deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      final ObjectCodec oc = jp.getCodec();
      final JsonNode node = oc.readTree(jp);
      final String priceString = node.path(0).asText();
      final String amountString = node.path(1).asText();

      return new CryptoTradePublicOrder(new BigDecimal(amountString), new BigDecimal(priceString));
    }
  }
}
View Full Code Here

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

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      BigDecimal volume = new BigDecimal(node.path(0).asText());
      BigDecimal fee = new BigDecimal(node.path(1).asText());

      return new KrakenFee(volume, fee);
    }
  }
View Full Code Here

    public KrakenFee deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      BigDecimal volume = new BigDecimal(node.path(0).asText());
      BigDecimal fee = new BigDecimal(node.path(1).asText());

      return new KrakenFee(volume, fee);
    }
  }
}
View Full Code Here

          Iterator<Map.Entry<String, JsonNode>> iter = marketNode.fields();
          if (iter.hasNext()) {
            Entry<String, JsonNode> entry = iter.next();
            CurrencyPair currencyPair = BTERAdapters.adaptCurrencyPair(entry.getKey());
            JsonNode marketInfoData = entry.getValue();
            int decimalPlaces = marketInfoData.path("decimal_places").asInt();
            BigDecimal minAmount = new BigDecimal(marketInfoData.path("min_amount").asText());
            BigDecimal fee = new BigDecimal(marketInfoData.path("fee").asText());
            BTERMarketInfo marketInfoObject = new BTERMarketInfo(currencyPair, decimalPlaces, minAmount, fee);

            marketInfoMap.put(currencyPair, marketInfoObject);
View Full Code Here

          if (iter.hasNext()) {
            Entry<String, JsonNode> entry = iter.next();
            CurrencyPair currencyPair = BTERAdapters.adaptCurrencyPair(entry.getKey());
            JsonNode marketInfoData = entry.getValue();
            int decimalPlaces = marketInfoData.path("decimal_places").asInt();
            BigDecimal minAmount = new BigDecimal(marketInfoData.path("min_amount").asText());
            BigDecimal fee = new BigDecimal(marketInfoData.path("fee").asText());
            BTERMarketInfo marketInfoObject = new BTERMarketInfo(currencyPair, decimalPlaces, minAmount, fee);

            marketInfoMap.put(currencyPair, marketInfoObject);
          }
View Full Code Here

            Entry<String, JsonNode> entry = iter.next();
            CurrencyPair currencyPair = BTERAdapters.adaptCurrencyPair(entry.getKey());
            JsonNode marketInfoData = entry.getValue();
            int decimalPlaces = marketInfoData.path("decimal_places").asInt();
            BigDecimal minAmount = new BigDecimal(marketInfoData.path("min_amount").asText());
            BigDecimal fee = new BigDecimal(marketInfoData.path("fee").asText());
            BTERMarketInfo marketInfoObject = new BTERMarketInfo(currencyPair, decimalPlaces, minAmount, fee);

            marketInfoMap.put(currencyPair, marketInfoObject);
          }
          else {
View Full Code Here

    public BTERPublicOrder deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

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

      final BigDecimal price = new BigDecimal(tickerNode.path(0).asText());
      final BigDecimal amount = new BigDecimal(tickerNode.path(1).asText());

      return new BTERPublicOrder(price, amount);
    }
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.