Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.ObjectNode.fields()


    final BigDecimal maxBid = getNumberIfPresent(tickerDataNode.path("max_bid").asText());
    BigDecimal volumeTradeCurrency = null;
    BigDecimal volumePriceCurrency = null;
    if (tickerDataNode instanceof ObjectNode) {
      final ObjectNode tickerDataObjectNode = (ObjectNode) tickerDataNode;
      final Iterator<Entry<String, JsonNode>> tickerDataFields = tickerDataObjectNode.fields();
      while (tickerDataFields.hasNext()) {
        final Entry<String, JsonNode> tickerDataEntry = tickerDataFields.next();
        if (tickerDataEntry.getKey().startsWith("vol_")) {
          if (volumeTradeCurrency == null)
            volumeTradeCurrency = getNumberIfPresent(tickerDataEntry.getValue().asText());
View Full Code Here


    final JsonNode rootNode = oc.readTree(jp);

    final Map<CurrencyPair, CryptoTradeTicker> tickers = new HashMap<CurrencyPair, CryptoTradeTicker>();
    if (rootNode.size() == 1) {
      final ObjectNode dataNode = (ObjectNode) rootNode.get(0);
      final Iterator<Entry<String, JsonNode>> tickersArray = dataNode.fields();
      while (tickersArray.hasNext()) {
        final Entry<String, JsonNode> tickerData = tickersArray.next();
        final CurrencyPair pair = CurrencyPairDeserializer.getCurrencyPairFromString(tickerData.getKey());
        final CryptoTradeTicker ticker = CryptoTradeTickerDeserializer.getTickerFromJsonNode(tickerData.getValue());
        tickers.put(pair, ticker);
View Full Code Here

      final BigDecimal buy = getNumberIfPresent(tickerNode.path("buy"));
      final Map<String, BigDecimal> volumes = new HashMap<String, BigDecimal>();

      if (tickerNode instanceof ObjectNode) {
        final ObjectNode tickerDataObjectNode = (ObjectNode) tickerNode;
        final Iterator<Entry<String, JsonNode>> tickerDataFields = tickerDataObjectNode.fields();
        while (tickerDataFields.hasNext()) {
          final Entry<String, JsonNode> tickerDataEntry = tickerDataFields.next();
          final String volumeEntryKey = tickerDataEntry.getKey();
          if (volumeEntryKey.startsWith("vol_")) {
            final BigDecimal volumeAmount = getNumberIfPresent(tickerDataEntry.getValue());
View Full Code Here

    List<VircurexOpenOrder> openOrdersList = new ArrayList<VircurexOpenOrder>();
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode jsonNodes = mapper.readTree(jsonParser);

    Iterator<Map.Entry<String, JsonNode>> jsonNodeIterator = jsonNodes.fields();

    while (jsonNodeIterator.hasNext()) {

      Map.Entry<String, JsonNode> jsonNodeField = jsonNodeIterator.next();
View Full Code Here

    @Override
    public SearchObject deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
        ObjectMapper mapper = (ObjectMapper) jp.getCodec();
        ObjectNode root = (ObjectNode) mapper.readTree(jp);
        Class<? extends SearchObject> searchClass = null;
        Iterator<Map.Entry<String, JsonNode>> elementsIterator = root.fields();

        while (elementsIterator.hasNext()) {
            Map.Entry<String, JsonNode> element = elementsIterator.next();
            String name = element.getKey();
            LOG.info("Name: {} = {}", name, element.getValue().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.