Examples of readValueAsTree()


Examples of com.fasterxml.jackson.core.JsonParser.readValueAsTree()

                    graphson.vertexFromJson(node);
                }
            } else if (fieldname.equals(GraphSONTokens.EDGES)) {
                jp.nextToken();
                while (jp.nextToken() != JsonToken.END_ARRAY) {
                    final JsonNode node = jp.readValueAsTree();
                    final Vertex inV = graph.getVertex(GraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._IN_V)));
                    final Vertex outV = graph.getVertex(GraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._OUT_V)));
                    graphson.edgeFromJson(node, outV, inV);
                }
            }
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParser.readValueAsTree()

        assertToken(JsonToken.START_ARRAY, jp.getCurrentToken());
        jp.clearCurrentToken();
        assertNull(jp.getCurrentToken());
        // Also: no codec defined by default
        try {
            jp.readValueAsTree();
            fail("Should get exception without codec");
        } catch (IllegalStateException e) {
            verifyException(e, "No ObjectCodec defined");
        }
        jp.close();
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParser.readValueAsTree()

        current = jp.nextToken();
        if (key.equals("features")) {
          while (jp.nextToken() != JsonToken.END_ARRAY) {
            // Read the feature into a tree model, which moves
            // parser to its end.
            JsonNode feature = jp.readValueAsTree();
            ret.addFeature(feature, index++);
          }
        } else {
          jp.skipChildren(); // ignore all other keys except features
        }
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParser.readValueAsTree()

        }

        try {
            JsonParser parser = jsonFactory.createJsonParser(schemaLocation);
            try {
                JsonNode rawSchema = parser.readValueAsTree();
                schemasToCompile.add(new ProcessingEntry(schemaLocation, rawSchema));
            } finally {
                parser.close();
            }
        } catch (JsonParseException jpe) {
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParser.readValueAsTree()

    private JsonNode getResponseTree( Response response )
        throws IOException
    {
        JsonParser jsonParser = jsonFactory.createParser( (InputStream) response.getEntity() );
        return (JsonNode) jsonParser.readValueAsTree();
    }

    private void reportErrors( Response resp )
        throws IOException, MojoExecutionException
    {
View Full Code Here

Examples of org.codehaus.jackson.JsonParser.readValueAsTree()

        if (file.exists()) {
          BufferedReader br =
              new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
          JsonParser parser = JSON_FACTORY.createJsonParser(br);
          JsonNode json = parser.readValueAsTree();
          br.close();
          scs.add(0, toObject(json));
        }
        mustache.execute(res.getWriter(), scs.toArray());
      }
View Full Code Here

Examples of org.codehaus.jackson.JsonParser.readValueAsTree()

    final Set<String> multiples = new HashSet<String>(Arrays.asList(
            "ZADD"
    ));
    JsonFactory jf = new MappingJsonFactory();
    JsonParser jsonParser = jf.createJsonParser(new URL("https://raw.github.com/antirez/redis-doc/master/commands.json"));
    final JsonNode commandNodes = jsonParser.readValueAsTree();
    Iterator<String> fieldNames = commandNodes.getFieldNames();
    ImmutableListMultimap<String,String> group = Multimaps.index(fieldNames,
            new Function<String, String>() {
              @Override
              public String apply(String s) {
View Full Code Here

Examples of org.codehaus.jackson.JsonParser.readValueAsTree()

            throw new IOException("The value of the 'span' field MUST BE an Json Array!");
        }
        boolean first = true;
        while(parser.nextValue() == JsonToken.START_OBJECT){
            if(first){
                parseAnalyzedTextSpan(parser.readValueAsTree(), at);
                first = false;
            } else {
                parseSpan(at, parser.readValueAsTree());
            }
        }
View Full Code Here

Examples of org.codehaus.jackson.JsonParser.readValueAsTree()

        while(parser.nextValue() == JsonToken.START_OBJECT){
            if(first){
                parseAnalyzedTextSpan(parser.readValueAsTree(), at);
                first = false;
            } else {
                parseSpan(at, parser.readValueAsTree());
            }
        }
        return at;
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonParser.readValueAsTree()

        while (jp.nextToken() != JsonToken.END_OBJECT) {
            String fieldName = jp.getCurrentName();
            current = jp.nextToken(); // move from field name to field value
            if (fieldName.equals("namespaces")) {
                if (current == JsonToken.START_OBJECT) {
                    jsonImport.readNamespaces((ObjectNode) jp.readValueAsTree());
                } else {
                    System.out.println("Error: namespaces property should be an object. Skipping.");
                    jp.skipChildren();
                }
            } else if (fieldName.equals("failuresFile")) {
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.