Examples of constructType()


Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

        TypeFactory tf = TypeFactory.defaultInstance();
        t = tf.constructType(new TypeReference<MyLongList<Integer>>() {});
        CollectionType type = (CollectionType) t;
        assertSame(MyLongList.class, type.getRawClass());
        assertEquals(tf.constructType(Long.class), type.getContentType());       

        t = tf.constructType(LongList.class);
        type = (CollectionType) t;
        assertSame(LongList.class, type.getRawClass());
        assertEquals(tf.constructType(Long.class), type.getContentType());       
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

        t = tf.constructType(new TypeReference<MyLongList<Integer>>() {});
        CollectionType type = (CollectionType) t;
        assertSame(MyLongList.class, type.getRawClass());
        assertEquals(tf.constructType(Long.class), type.getContentType());       

        t = tf.constructType(LongList.class);
        type = (CollectionType) t;
        assertSame(LongList.class, type.getRawClass());
        assertEquals(tf.constructType(Long.class), type.getContentType());       
    }
}
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

        assertEquals(tf.constructType(Long.class), type.getContentType());       

        t = tf.constructType(LongList.class);
        type = (CollectionType) t;
        assertSame(LongList.class, type.getRawClass());
        assertEquals(tf.constructType(Long.class), type.getContentType());       
    }
}
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

    }

    private Class<?> findAdapterBoundType(XmlAdapter<?,?> adapter)
    {
        TypeFactory tf = getTypeFactory();
        JavaType adapterType = tf.constructType(adapter.getClass());
        JavaType[] params = tf.findTypeParameters(adapterType, XmlAdapter.class);
        // should not happen, except if our type resolution has a flaw, but:
        if (params == null || params.length < 2) {
            return Object.class;
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

    }

    private Class<?> findAdapterBoundType(XmlAdapter<?,?> adapter)
    {
        TypeFactory tf = getTypeFactory();
        JavaType adapterType = tf.constructType(adapter.getClass());
        JavaType[] params = tf.findTypeParameters(adapterType, XmlAdapter.class);
        // should not happen, except if our type resolution has a flaw, but:
        if (params == null || params.length < 2) {
            return Object.class;
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

        throws JsonMappingException
    {
        // [JACKSON-404] Need to figure out generic type parameters used...
        TypeFactory typeFactory = ctxt.getTypeFactory();

        JavaType type = typeFactory.constructType(_xmlAdapter.getClass());
        JavaType[] rawTypes = typeFactory.findTypeParameters(type, XmlAdapter.class);
        JavaType valueType = (rawTypes == null || rawTypes.length == 0)
            ? TypeFactory.unknownType() : rawTypes[0];
        JsonDeserializer<Object> deser = ctxt.findContextualValueDeserializer(valueType, property);
        return new XmlAdapterJsonDeserializer(_xmlAdapter, valueType, deser);
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

    public JsonSerializer<Object> createContextual(SerializerProvider prov,
            BeanProperty property) throws JsonMappingException
    {
        TypeFactory typeFactory = prov.getConfig().getTypeFactory();

        JavaType type = typeFactory.constructType(_xmlAdapter.getClass());
        JavaType[] rawTypes = typeFactory.findTypeParameters(type, XmlAdapter.class);
        JavaType valueType;
       
        if (rawTypes == null || rawTypes.length < 2) {
            valueType = TypeFactory.unknownType();
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

        }

        api.setApis(apis);


        models.putAll(buildModels(endpoint, typeFactory.constructType(pluginVersion.getApiClass())));

        if(plugin.isMethodAllowed(HttpMethod.GET))
            models.putAll(buildModels(String.format("%sEntityResponse", plugin.getEndpointName()),
                    typeFactory.constructParametricType(EntityResponse.class, pluginVersion.getApiClass())));
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

            models.putAll(buildModels(String.format("%sEntityResponse", plugin.getEndpointName()),
                    typeFactory.constructParametricType(EntityResponse.class, pluginVersion.getApiClass())));

        if(plugin.isMethodAllowed(HttpMethod.DELETE))
            models.putAll(buildModels(String.format("%sDeleteResponse", plugin.getEndpointName()),
                    typeFactory.constructType(DeleteResponse.class)));

        return api;
    }

    private Api buildHistory(EntityPlugin plugin,ResourceBundle resourceBundle)
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory.constructType()

    }

    private Class<?> findAdapterBoundType(XmlAdapter<?,?> adapter)
    {
        TypeFactory tf = getTypeFactory();
        JavaType adapterType = tf.constructType(adapter.getClass());
        JavaType[] params = tf.findTypeParameters(adapterType, XmlAdapter.class);
        // should not happen, except if our type resolution has a flaw, but:
        if (params == null || params.length < 2) {
            return Object.class;
        }
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.