protected void _resolve() { _resolveBindings(_contextClass); // finally: may have root level type info too if (_contextType != null) { int count = _contextType.containedTypeCount(); if (count > 0) { if (_bindings == null) { _bindings = new LinkedHashMap<String,JavaType>(); } for (int i = 0; i < count; ++i) { String name = _contextType.containedTypeName(i); JavaType type = _contextType.containedType(i); _bindings.put(name, type); } } } // nothing bound? mark with empty map to prevent further calls if (_bindings == null) { _bindings = Collections.emptyMap(); } }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
JavaType[] result = new JavaType[count]; for (int i = 0; i < count; ++i) { result[i] = type.containedType(i);
protected void _resolve() { _resolveBindings(_contextClass); // finally: may have root level type info too if (_contextType != null) { int count = _contextType.containedTypeCount(); if (count > 0) { if (_bindings == null) { _bindings = new LinkedHashMap<String,JavaType>(); } for (int i = 0; i < count; ++i) { String name = _contextType.containedTypeName(i); JavaType type = _contextType.containedType(i); _bindings.put(name, type); } } } // nothing bound? mark with empty map to prevent further calls if (_bindings == null) { _bindings = Collections.emptyMap(); } }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
JavaType[] result = new JavaType[count]; for (int i = 0; i < count; ++i) { result[i] = type.containedType(i);
protected void _resolve() { _resolveBindings(_contextClass); // finally: may have root level type info too if (_contextType != null) { int count = _contextType.containedTypeCount(); if (count > 0) { if (_bindings == null) { _bindings = new LinkedHashMap<String,JavaType>(); } for (int i = 0; i < count; ++i) { String name = _contextType.containedTypeName(i); JavaType type = _contextType.containedType(i); _bindings.put(name, type); } } } // nothing bound? mark with empty map to prevent further calls if (_bindings == null) { _bindings = Collections.emptyMap(); } }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
@Override public JsonDeserializer<?> deserializerInstance(DeserializationConfig config, Annotated annotated, Class<? extends JsonDeserializer<?>> deserClass) { if (deserClass.equals(DBRefDeserializer.class)) { JavaType type = config.getTypeFactory().constructType(annotated.getGenericType()); JavaType dbRefType; if (type.isContainerType()) { if (type.isCollectionLikeType()) { dbRefType = type.containedType(0); } else if (type.isMapLikeType()) { dbRefType = type.containedType(1); } else { return null; } } else { dbRefType = type; } Class<? extends JsonDeserializer> keyDeserializer = introspector.findObjectIdDeserializer(dbRefType.containedType(1)); return new DBRefDeserializer(dbRefType.containedType(0), dbRefType.containedType(1), ClassUtil.createInstance(keyDeserializer, false)); } return null; }
public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property) throws JsonMappingException { if (type.getRawClass() == DBRef.class) { if (!type.hasGenericTypes()) { throw new JsonMappingException("Property " + property + " doesn't declare object and key type"); } JavaType objectType = type.containedType(0); JavaType keyType = type.containedType(1); return new DBRefDeserializer(objectType, keyType); } return super.findBeanDeserializer(type, config, provider, beanDesc, property); } }
public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property) throws JsonMappingException { if (type.getRawClass() == DBRef.class) { if (!type.hasGenericTypes()) { throw new JsonMappingException("Property " + property + " doesn't declare object and key type"); } JavaType objectType = type.containedType(0); JavaType keyType = type.containedType(1); return new DBRefDeserializer(objectType, keyType); } return super.findBeanDeserializer(type, config, provider, beanDesc, property); } }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
@Override public Class findContentDeserializer(Annotated am) { if (am.hasAnnotation(ObjectId.class)) { JavaType type = deserializationConfig.getTypeFactory().constructType(am.getGenericType()); if (type.isCollectionLikeType()) { return findObjectIdDeserializer(type.containedType(0)); } else if (type.isMapLikeType()) { return findObjectIdDeserializer(type.containedType(1)); } } return null; }
@Override public Class findContentDeserializer(Annotated am) { if (am.hasAnnotation(ObjectId.class)) { JavaType type = deserializationConfig.getTypeFactory().constructType(am.getGenericType()); if (type.isCollectionLikeType()) { return findObjectIdDeserializer(type.containedType(0)); } else if (type.isMapLikeType()) { return findObjectIdDeserializer(type.containedType(1)); } } return null; }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return ContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return ContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }