Examples of valueToTree()


Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        String resultString = loadJsonFromFile("web.json");
        ConfigurationDefinition definition = loadDescriptor("test9");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        String resultString = loadJsonFromFile("expressionTest.json");
        ConfigurationDefinition definition = loadDescriptor("test12");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        ConfigurationDefinition definition = loadDescriptor("test13");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        ConfigurationDefinition definition = loadDescriptor("test13a");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        ConfigurationDefinition definition = loadDescriptor("listOfPlainMaps");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        ConfigurationDefinition definition = loadDescriptor("groupedproperties");

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        FakeConnection connection = new FakeConnection();
        connection.setContent(json);

        ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        ConfigurationDefinition definition = loadServiceDescriptorElement("simpleGroupNoSpecial");

        //Formally construct the json response
        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
        JsonNode json = mapper.valueToTree(result);

        //Create fake connection and prepopulate the response.
        FakeConnection connection = new FakeConnection();
        connection.setContent(json);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

    private static JsonNode toJson(final DateRangePickerOptions pickerOptions) {
        final ObjectMapper mapper = new ObjectMapper();
        mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
        mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
        return mapper.valueToTree(pickerOptions);
    }

}
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

        config.setTimeToLive(3360);
        unifiedPushMessage.setConfig(config);

        //then
        final ObjectMapper mapper = new ObjectMapper();
        final JsonNode value = mapper.valueToTree(unifiedPushMessage);

        JsonNode format = mapper.reader().readTree(getClass().getResourceAsStream("/message-format.json"));
        assertEquals(format, value);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.valueToTree()

public abstract class Entity {
   
  public ObjectNode toJson(boolean includeIdAndRev) {
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode root = mapper.valueToTree(this);   
    if (includeIdAndRev) {
      root.put("id", getId());
      root.put("revision", getRevision());
    }
    return root;
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.