Package com.fasterxml.jackson.databind

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


            JsonNode linksNode = rootNode.get(LINKS);
            if (linksNode.has(CURIES)) {
                JsonNode curieNode = linksNode.get(CURIES);

                if (curieNode.isArray()) {
                    Iterator<JsonNode> values = curieNode.elements();
                    while (values.hasNext()) {
                        JsonNode valueNode = values.next();
                        resource.withNamespace(valueNode.get(NAME).asText(), valueNode.get(HREF).asText());
                    }
                } else {
View Full Code Here


    private <K, V, M extends Map<K, V>> M deserializeIntoMap(JsonReadGenericRecord rec, String fieldName, NFTypeSerializer<K> keySerializer, NFTypeSerializer<V> valueSerializer, M map) {
        JsonNode node = getJsonNode(rec, fieldName);
        if (node == null) {
            return null;
        }
        for (Iterator<JsonNode> it = node.elements(); it.hasNext();) {
            JsonNode element = it.next();
            K key = keySerializer.deserialize(new JsonReadGenericRecord(keySerializer.getFastBlobSchema(), element.get("key")));
            V value = valueSerializer.deserialize(new JsonReadGenericRecord(valueSerializer.getFastBlobSchema(), element.get("value")));
            map.put(key, value);
        }
View Full Code Here

            List eventArgs = new ArrayList();
            Event event = new Event(eventName, eventArgs);
            JsonNode args = root.get("args");
            if (args != null) {
                Iterator<JsonNode> iterator = args.elements();
                if (iterator.hasNext()) {
                    JsonNode node = iterator.next();
                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
View Full Code Here

      if(n.has("section") && n.get("section").textValue().equalsIgnoreCase(section)){
        JsonNode subValues = n.get("sub sections").get(subsection);

        if(subValues!= null){
          Iterator<JsonNode> keys = subValues.elements();
          while(keys.hasNext()){
            JsonNode keyNode = keys.next();
            if(keyNode.has(key)){
              result = keyNode.get(key).textValue();
              break;
View Full Code Here

        final JsonNode propertyConfig = config.get("defaultConfig");
        this.filterAnalyticsGroups(groupMember, propertyConfig, isMemberCache);
       
        final JsonNode hosts = config.get("hosts");
        if (hosts != null) {
            for (final Iterator<JsonNode> hostsItr = hosts.elements(); hostsItr.hasNext(); ) {
                final JsonNode institution = hostsItr.next();
                this.filterAnalyticsGroups(groupMember, institution, isMemberCache);
            }
        }
       
View Full Code Here

        final JsonNode dimensionGroups = config.get("dimensionGroups");
        if (dimensionGroups == null) {
            return;
        }
       
        for (final Iterator<JsonNode> groupItr = dimensionGroups.elements(); groupItr.hasNext(); ) {
            final JsonNode group = groupItr.next();
           
            final JsonNode valueNode = group.get("value");
            if (valueNode == null) {
                continue;
View Full Code Here

        final SearchResults searchResults = new SearchResults();
        searchResults.setQueryId(query.getQueryId());
        final List<SearchResult> searchResultList = searchResults.getSearchResult();
       
        final JsonNode results = googleResponse.get("responseData").get("results");
        for (final Iterator<JsonNode> resultItr = results.elements(); resultItr.hasNext();) {
            final JsonNode googleResult = resultItr.next();
           
            final SearchResult searchResult = new SearchResult();
            searchResult.setTitle(googleResult.get("title").asText());
            searchResult.setSummary(googleResult.get("content").asText());
View Full Code Here

            }

            JsonNode attributesNode = queryNode.path("attributes");
            if (attributesNode.isMissingNode()) {
            } else if (attributesNode.isArray()) {
                Iterator<JsonNode> itAttributeNode = attributesNode.elements();
                while (itAttributeNode.hasNext()) {
                    JsonNode attributeNode = itAttributeNode.next();
                    parseQueryAttributeNode(query, attributeNode);
                }
            } else {
View Full Code Here

            if (keysNode.isMissingNode()) {
            } else if (keysNode.isArray()) {
                if (keys == null) {
                    keys = new ArrayList<String>();
                }
                Iterator<JsonNode> itAttributeNode = keysNode.elements();
                while (itAttributeNode.hasNext()) {
                    JsonNode keyNode = itAttributeNode.next();
                    if (keyNode.isValueNode()) {
                        keys.add(keyNode.asText());
                    } else {
View Full Code Here

            List eventArgs = new ArrayList();
            Event event = new Event(eventName, eventArgs);
            JsonNode args = root.get("args");
            if (args != null) {
                Iterator<JsonNode> iterator = args.elements();
                if (iterator.hasNext()) {
                    JsonNode node = iterator.next();
                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
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.