Package org.codehaus.jackson

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


    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

            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

        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

        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

                    openStreams(jp.getText());
                }
            } else if (fieldName.equals("fieldTypes")) {
                if (current == JsonToken.START_ARRAY) {
                    while (jp.nextToken() != JsonToken.END_ARRAY) {
                        importFieldType(jp.readValueAsTree());
                    }
                } else {
                    System.out.println("Error: fieldTypes property should be an array. Skipping.");
                    jp.skipChildren();
                }
View Full Code Here

                    jp.skipChildren();
                }
            } else if (fieldName.equals("recordTypes")) {
                if (current == JsonToken.START_ARRAY) {
                    while (jp.nextToken() != JsonToken.END_ARRAY) {
                        importRecordType(jp.readValueAsTree());
                    }
                } else {
                    System.out.println("Error: recordTypes property should be an array. Skipping.");
                    jp.skipChildren();
                }
View Full Code Here

                    jp.skipChildren();
                }
            } else if (fieldName.equals("recordSpaces")) {
                if (current == JsonToken.START_ARRAY) {
                    while (jp.nextToken() != JsonToken.END_ARRAY) {
                        recordSpacesConfig.add(jp.readValueAsTree());
                    }
                    for (int i = 0; i < workers; i++) {
                        workersRecordSpaces.add(new RecordSpaces(recordSpacesConfig));
                    }
                } else {
View Full Code Here

                    jp.skipChildren();
                }
            } else if (fieldName.equals("scenario")) {
                if (current == JsonToken.START_ARRAY) {
                    while (jp.nextToken() != JsonToken.END_ARRAY) {
                        JsonNode actionNode = jp.readValueAsTree();
                        prepareAction(actionNode);
                    }
                } else {
                    System.out.println("Error: recordSpaces property should be an array. Skipping.");
                    jp.skipChildren();
View Full Code Here

                    System.out.println("Error: recordSpaces property should be an array. Skipping.");
                    jp.skipChildren();
                }
            } else if (fieldName.equals("stopConditions")) {
                if (current == JsonToken.START_OBJECT) {
                    readStopConditions((ObjectNode) jp.readValueAsTree());
                } else {
                    System.out.println("Error: stopConditions property should be an object. Skipping.");
                    jp.skipChildren();
                }
            }
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.