Package com.fasterxml.jackson.databind.node

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


            // Check if it is a "RealFilter"
            JsonNode queryParam = root.get("queryParam");
            if ( queryParam != null && queryParam.isValueNode() ) {

                // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
                JsonParser subJsonParser = root.traverse( objectCodec );

                return subJsonParser.readValueAs( RealFilter.class );
            }

            // We assume it is a LogicalFilter
View Full Code Here


                throws IOException {

            ObjectNode root = jp.readValueAsTree();

            // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
            JsonParser subJsonParser = root.traverse( jp.getCodec() );

            // Check if it is a "RealFilter"
            JsonNode valuesParam = root.get("values");

            if ( valuesParam == null ) {
View Full Code Here

                throws IOException {

            ObjectNode root = jp.readValueAsTree();

            // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
            JsonParser subJsonParser = root.traverse( jp.getCodec() );

            // Check if it is a "RealFilter"
            JsonNode valueParam = root.get("value");

            if ( valueParam == null ) {
View Full Code Here

            JsonNode queryParam = root.get("queryParam");
            String value = queryParam.asText();

            // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
            JsonParser subJsonParser = root.traverse( jp.getCodec() );

            // Determine the "type" of filter we are dealing with Real or Logical and specify type
            if ( "OR".equals( value ) || "AND".equals( value ) ) {
                return subJsonParser.readValueAs( LogicalFilter1.class );
            }
View Full Code Here

                throws IOException {

            ObjectNode root = jp.readValueAsTree();

            // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
            JsonParser subJsonParser = root.traverse( jp.getCodec() );

            // Check if it is a "RealFilter"
            JsonNode queryParam = root.get("queryParam");
            if ( queryParam != null && queryParam.isValueNode() ) {
                return subJsonParser.readValueAs( RealFilter.class );
View Full Code Here

    {
        ObjectMapper o = new ObjectMapper();
        ObjectNode n = o.createObjectNode();
        n.putObject("inner").put("value", "test");
        n.putObject("unknown").putNull("inner");
        Jackson370Bean obj = o.readValue(n.traverse(), Jackson370Bean.class);
        assertNotNull(obj.inner);
        assertEquals("test", obj.inner.value);       
    }
}
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.