Examples of containedType()


Examples of com.fasterxml.jackson.databind.JavaType.containedType()

    @Override
    public JsonDeserializer findContentDeserializer(Annotated am) {
        if (am.hasAnnotation(ObjectId.class)) {
            JavaType type = typeFactory.constructType(am.getGenericType());
            if (type.isCollectionLikeType()) {
                return findObjectIdDeserializer(type.containedType(0));
            } else if (type.isMapLikeType()) {
                return findObjectIdDeserializer(type.containedType(1));
            }
        }
        return null;
View Full Code Here

Examples of com.fasterxml.jackson.databind.JavaType.containedType()

        if (am.hasAnnotation(ObjectId.class)) {
            JavaType type = typeFactory.constructType(am.getGenericType());
            if (type.isCollectionLikeType()) {
                return findObjectIdDeserializer(type.containedType(0));
            } else if (type.isMapLikeType()) {
                return findObjectIdDeserializer(type.containedType(1));
            }
        }
        return null;
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.JavaType.containedType()

                    return null;
                }
            } else {
                dbRefType = type;
            }
            JsonDeserializer keyDeserializer = findObjectIdDeserializer(dbRefType
                    .containedType(1));
            return new DBRefDeserializer(dbRefType.containedType(0),
                    dbRefType.containedType(1), keyDeserializer);
        } else if (type.getRawClass() == org.bson.types.ObjectId.class) {
            // Don't know why someone would annotated an ObjectId with
View Full Code Here

Examples of com.fasterxml.jackson.databind.JavaType.containedType()

            } else {
                dbRefType = type;
            }
            JsonDeserializer keyDeserializer = findObjectIdDeserializer(dbRefType
                    .containedType(1));
            return new DBRefDeserializer(dbRefType.containedType(0),
                    dbRefType.containedType(1), keyDeserializer);
        } else if (type.getRawClass() == org.bson.types.ObjectId.class) {
            // Don't know why someone would annotated an ObjectId with
            // @ObjectId, but handle it
            return new ObjectIdDeserializers.ToObjectIdDeserializer();
View Full Code Here

Examples of com.fasterxml.jackson.databind.JavaType.containedType()

                dbRefType = type;
            }
            JsonDeserializer keyDeserializer = findObjectIdDeserializer(dbRefType
                    .containedType(1));
            return new DBRefDeserializer(dbRefType.containedType(0),
                    dbRefType.containedType(1), keyDeserializer);
        } else if (type.getRawClass() == org.bson.types.ObjectId.class) {
            // Don't know why someone would annotated an ObjectId with
            // @ObjectId, but handle it
            return new ObjectIdDeserializers.ToObjectIdDeserializer();
        }
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType.containedType()

        TypeFactory tf = TypeFactory.defaultInstance();
        JavaType t = tf.constructType(new TypeReference<Iterator<String>>() { });
        assertEquals(SimpleType.class, t.getClass());
        assertSame(Iterator.class, t.getRawClass());
        assertEquals(1, t.containedTypeCount());
        assertEquals(tf.constructType(String.class), t.containedType(0));
        assertNull(t.containedType(1));
    }

    /**
     * Test for verifying that parametric types can be constructed
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType.containedType()

        JavaType t = tf.constructType(new TypeReference<Iterator<String>>() { });
        assertEquals(SimpleType.class, t.getClass());
        assertSame(Iterator.class, t.getRawClass());
        assertEquals(1, t.containedTypeCount());
        assertEquals(tf.constructType(String.class), t.containedType(0));
        assertNull(t.containedType(1));
    }

    /**
     * Test for verifying that parametric types can be constructed
     * programmatically
 
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType.containedType()

        // Then using JavaType
        JavaType t2 = tf.constructParametricType(Map.class, strC, t); // Map<String,ArrayList<String>>
        // should actually produce a MapType
        assertEquals(MapType.class, t2.getClass());
        assertEquals(2, t2.containedTypeCount());
        assertEquals(strC, t2.containedType(0));
        assertEquals(t, t2.containedType(1));
        assertNull(t2.containedType(2));

        // and then custom generic type as well
        JavaType custom = tf.constructParametricType(SingleArgGeneric.class, String.class);
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType.containedType()

        JavaType t2 = tf.constructParametricType(Map.class, strC, t); // Map<String,ArrayList<String>>
        // should actually produce a MapType
        assertEquals(MapType.class, t2.getClass());
        assertEquals(2, t2.containedTypeCount());
        assertEquals(strC, t2.containedType(0));
        assertEquals(t, t2.containedType(1));
        assertNull(t2.containedType(2));

        // and then custom generic type as well
        JavaType custom = tf.constructParametricType(SingleArgGeneric.class, String.class);
        assertEquals(SimpleType.class, custom.getClass());
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType.containedType()

        // should actually produce a MapType
        assertEquals(MapType.class, t2.getClass());
        assertEquals(2, t2.containedTypeCount());
        assertEquals(strC, t2.containedType(0));
        assertEquals(t, t2.containedType(1));
        assertNull(t2.containedType(2));

        // and then custom generic type as well
        JavaType custom = tf.constructParametricType(SingleArgGeneric.class, String.class);
        assertEquals(SimpleType.class, custom.getClass());
        assertEquals(1, custom.containedTypeCount());
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.