Package org.codehaus.jackson.map.type

Examples of org.codehaus.jackson.map.type.TypeFactory


            throw new ZencoderClientException(hcee.getResponseBodyAsString(), hcee);
        }

        List<ZencoderJobDetailResponse> jobs = null;
        try {
            TypeFactory typeFactory = TypeFactory.defaultInstance();
            jobs = mapper.readValue(
                    response.getBody(),
                    typeFactory.constructCollectionType(List.class, ZencoderJobDetailResponse.class));

        } catch (Exception e) {
            throw new ZencoderClientException(
                    "Unable to deserialize ZencoderCreateJobResponse as JSON",
                    e);
View Full Code Here


   
    // @since 1.9
    public void testJavaType() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        TypeFactory tf = TypeFactory.defaultInstance();
        // first simple type:
        String json = mapper.writeValueAsString(tf.constructType(String.class));
        assertEquals(quote(java.lang.String.class.getName()), json);
        // and back
        JavaType t = mapper.readValue(json, JavaType.class);
        assertNotNull(t);
        assertEquals(String.class, t.getRawClass());
View Full Code Here

                mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
            }

            //@Override
            public void addTypeModifier(TypeModifier modifier) {
                TypeFactory f = mapper._typeFactory;
                f = f.withModifier(modifier);
                mapper.setTypeFactory(f);
            }

            //@Override
            public void addValueInstantiators(ValueInstantiators instantiators) {
View Full Code Here

                mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
            }

            @Override
            public void addTypeModifier(TypeModifier modifier) {
                TypeFactory f = mapper._typeFactory;
                f = f.withModifier(modifier);
                mapper.setTypeFactory(f);
            }
           
            @Override
            public void insertAnnotationIntrospector(AnnotationIntrospector ai) {
View Full Code Here

                mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
            }

            @Override
            public void addTypeModifier(TypeModifier modifier) {
                TypeFactory f = mapper._typeFactory;
                f = f.withModifier(modifier);
                mapper.setTypeFactory(f);
            }

            @Override
            public void addValueInstantiators(ValueInstantiators instantiators) {
View Full Code Here

        /* 14-Mar-2011, tatu: This is sub-optimal, as we really should use
         *    configured TypeFactory, not global one; but it should not cause
         *    issues here (issue would be that it will ignore module-provided additional
         *    type manging, most relevant for languages other than Java)
         */
        TypeFactory typeFactory = TypeFactory.defaultInstance();

        JavaType type = typeFactory.constructType(xmlAdapter.getClass());
        JavaType[] rawTypes = typeFactory.findTypeParameters(type, XmlAdapter.class);
        _valueType = (rawTypes == null || rawTypes.length == 0)
            ? TypeFactory.unknownType() : rawTypes[0];
    }
View Full Code Here

                mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
            }

            @Override
            public void addTypeModifier(TypeModifier modifier) {
                TypeFactory f = mapper._typeFactory;
                f = f.withModifier(modifier);
                mapper.setTypeFactory(f);
            }

            @Override
            public void addValueInstantiators(ValueInstantiators instantiators) {
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.type.TypeFactory

Copyright © 2018 www.massapicom. 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.