Examples of readValueAs()


Examples of com.addthis.codec.config.ConfigTraversingParser.readValueAs()

    }

    public <T> T decodeObject(@Nonnull Class<T> type, ConfigValue configValue)
            throws JsonProcessingException, IOException {
        ConfigTraversingParser configParser = new ConfigTraversingParser(configValue, objectMapper);
        return validate(configParser.readValueAs(type));
    }

    public <T> T decodeObject(@Nonnull Class<T> type, JsonNode jsonNode) throws JsonProcessingException {
        return validate(objectMapper.treeToValue(jsonNode, type));
    }
View Full Code Here

Examples of com.addthis.codec.jackson.tree.ConfigTraversingParser.readValueAs()

    // doesn't delegate
    public <T> T decodeObject(@Nonnull Class<T> type, ConfigValue configValue)
            throws JsonProcessingException, IOException {
        ConfigTraversingParser configParser = new ConfigTraversingParser(configValue, objectMapper);
        return validate(configParser.readValueAs(type));
    }

    // doesn't delegate
    public <T> T decodeObject(@Nonnull Class<T> type, JsonNode jsonNode) throws JsonProcessingException {
        return validate(objectMapper.treeToValue(jsonNode, type));
View Full Code Here

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

            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
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();
View Full Code Here

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

                throw new RuntimeException( "Invalid format of LogicalFilter encountered." );
            }

            // pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
            JsonParser subJsonParser = arrayNode.traverse( objectCodec );
            List<QueryFilter> childrenQueryFilters = subJsonParser.readValueAs( new TypeReference<List<QueryFilter>>() {} );

            return new LogicalFilter2( QueryParam.valueOf( key ), childrenQueryFilters );
        }
    }
View Full Code Here

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

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

            if ( valuesParam == null ) {
                 return subJsonParser.readValueAs( LogicalFilter5.class );
            }
            if ( ! valuesParam.isArray() ) {
               throw new RuntimeException( "Expected an Array");
            }
View Full Code Here

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

            }
            if ( ! valuesParam.isArray() ) {
               throw new RuntimeException( "Expected an Array");
            }

            return subJsonParser.readValueAs( RealFilter5.class );
        }
    }

    @Test
    public void testPolymorphicJacksonSerializationAndDeserialization()
View Full Code Here

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

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

            if ( valueParam == null ) {
                 return subJsonParser.readValueAs( LogicalFilter4.class );
            }
            if ( valueParam.isBoolean() ) {
                return subJsonParser.readValueAs( BooleanRealFilter4.class );
            }
            else if ( valueParam.isTextual() ) {
View Full Code Here

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

            if ( valueParam == null ) {
                 return subJsonParser.readValueAs( LogicalFilter4.class );
            }
            if ( valueParam.isBoolean() ) {
                return subJsonParser.readValueAs( BooleanRealFilter4.class );
            }
            else if ( valueParam.isTextual() ) {
                return subJsonParser.readValueAs( StringRealFilter4.class );
            }
            else if ( valueParam.isIntegralNumber() ) {
View Full Code Here

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

            }
            if ( valueParam.isBoolean() ) {
                return subJsonParser.readValueAs( BooleanRealFilter4.class );
            }
            else if ( valueParam.isTextual() ) {
                return subJsonParser.readValueAs( StringRealFilter4.class );
            }
            else if ( valueParam.isIntegralNumber() ) {
                return subJsonParser.readValueAs( IntegerRealFilter4.class );
            }
            else {
View Full Code Here

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

            }
            else if ( valueParam.isTextual() ) {
                return subJsonParser.readValueAs( StringRealFilter4.class );
            }
            else if ( valueParam.isIntegralNumber() ) {
                return subJsonParser.readValueAs( IntegerRealFilter4.class );
            }
            else {
                throw new RuntimeException("Unknown type");
            }
        }
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.