Examples of fieldNames()


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

                            final JsonNode resultTree = new ObjectMapper().readTree(response.getResponseBody());
                            final String clusterName = resultTree.get("cluster_name").textValue();
                            final JsonNode nodesList = resultTree.get("nodes");

                            final Iterator<String> nodes = nodesList.fieldNames();
                            while (nodes.hasNext()) {
                                final String id = nodes.next();
                                final Version clusterVersion = Version.fromString(nodesList.get(id).get("version").textValue());

                                if (!configuration.isEsDisableVersionCheck()) {
View Full Code Here

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

    public Link deserialize(JsonParser jsonParser,
                            DeserializationContext deserializationContext) throws IOException, JsonProcessingException {

        ObjectCodec oc = jsonParser.getCodec();
        JsonNode node = oc.readTree(jsonParser);
        String rel = node.fieldNames().next();
        String href = node.elements().next().get("href").textValue();


        return new Link(rel,href);
    }
View Full Code Here

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

            classConfig = node.get(tmp);
           
            try {
                type = Class.forName(tmp, false, loader);
                typeBinder = binder.instance(type);
                names = classConfig.fieldNames();
               
                if (names.hasNext()) {
                    tmp = names.next();
                    typeNode = classConfig.get(tmp);
                   
View Full Code Here

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

            json = json.get("attributes");
            if (json != null) {
                final Iterator<JsonNode> nodes = json.iterator();
                while (nodes.hasNext()) {
                    json = nodes.next();
                    final String attribute = json.fieldNames().next();
                    userProfile.addAttribute(attribute, JsonHelper.get(json, attribute));
                }
            }
        }
        return userProfile;
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ArrayNode.fieldNames()

    public void testBasics() throws IOException
    {
        ArrayNode n = new ArrayNode(JsonNodeFactory.instance);
        assertStandardEquals(n);
        assertFalse(n.elements().hasNext());
        assertFalse(n.fieldNames().hasNext());
        TextNode text = TextNode.valueOf("x");
        n.add(text);
        assertEquals(1, n.size());
        assertFalse(0 == n.hashCode());
        assertTrue(n.elements().hasNext());
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ArrayNode.fieldNames()

        n.add(text);
        assertEquals(1, n.size());
        assertFalse(0 == n.hashCode());
        assertTrue(n.elements().hasNext());
        // no field names for arrays
        assertFalse(n.fieldNames().hasNext());
        assertNull(n.get("x")); // not used with arrays
        assertTrue(n.path("x").isMissingNode());
        assertSame(text, n.get(0));

        // single element, so:
View Full Code Here

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

                return subJsonParser.readValueAs( RealFilter.class );
            }

            // We assume it is a LogicalFilter
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();

            JsonNode arrayNode = root.iterator().next();
            if ( arrayNode == null || arrayNode.isMissingNode() || ! arrayNode.isArray() ) {
                throw new RuntimeException( "Invalid format of LogicalFilter encountered." );
View Full Code Here

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

            ObjectCodec objectCodec = jp.getCodec();
            ObjectNode root = jp.readValueAsTree();

            // We assume it is a LogicalFilter
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();

            JsonNode arrayNode = root.iterator().next();
            if ( arrayNode == null || arrayNode.isMissingNode() || ! arrayNode.isArray() ) {
                throw new RuntimeException( "Invalid format of LogicalFilter encountered." );
View Full Code Here

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

            ObjectCodec objectCodec = jp.getCodec();
            ObjectNode root = jp.readValueAsTree();

            // We assume it is a LogicalFilter
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();

            JsonNode arrayNode = root.iterator().next();
            if ( arrayNode == null || arrayNode.isMissingNode() || ! arrayNode.isArray() ) {
                throw new RuntimeException( "Invalid format of LogicalFilter encountered." );
View Full Code Here

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

        if (node.isNull())
            return null;
        else if (node.isObject()) {
            final Map<String, Object> map = new HashMap<>();
            final ObjectNode objectNode = (ObjectNode) node;
            final Iterator<String> iterator = objectNode.fieldNames();
            while (iterator.hasNext()) {
                String key = iterator.next();
                map.put(key, fromJsonNode(objectNode.get(key)));
            }
            return map;
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.