@Override public ArrayType withContentTypeHandler(Object h) { if (h == _componentType.getTypeHandler()) { return this; } return new ArrayType(_componentType.withTypeHandler(h), _emptyArray, _valueHandler, _typeHandler); }
h = baseType.getTypeHandler(); if (h != null) { subtype = subtype.withTypeHandler(h);
/** * More efficient version of {@link #narrowBy}, called by * internal framework in cases where compatibility checks * are to be skipped. * * @since 1.5 */ public JavaType forcedNarrowBy(Class<?> subclass) { if (subclass == _class) { // can still optimize for simple case return this; } JavaType result = _narrow(subclass); // TODO: these checks should NOT actually be needed; above should suffice: if (_valueHandler != result.getValueHandler()) { result = result.withValueHandler(_valueHandler); } if (_typeHandler != result.getTypeHandler()) { result = result.withTypeHandler(_typeHandler); } return result; }
/** * Method that can be called to do a "narrowing" conversions; that is, * to return a type with a raw class that is assignable to the raw * class of this type. If this is not possible, an * {@link IllegalArgumentException} is thrown. * If class is same as the current raw class, instance itself is * returned. */ public JavaType narrowBy(Class<?> subclass) { // First: if same raw class, just return this instance if (subclass == _class) { return this; } // Otherwise, ensure compatibility _assertSubclass(subclass, _class); JavaType result = _narrow(subclass); // TODO: these checks should NOT actually be needed; above should suffice: if (_valueHandler != result.getValueHandler()) { result = result.withValueHandler(_valueHandler); } if (_typeHandler != result.getTypeHandler()) { result = result.withTypeHandler(_typeHandler); } return result; }
TypeDeserializer elemTypeDeser = elemType.getTypeHandler();
@Override public JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationConfig config, DeserializerProvider p, CollectionLikeType type, BeanProperty property) throws JsonMappingException { // First: global defaulting: type = (CollectionLikeType) mapAbstractType(config, type); Class<?> collectionClass = type.getRawClass(); BasicBeanDescription beanDesc = config.introspectClassAnnotations(collectionClass); // Explicit deserializer to use? (@JsonDeserialize.using) JsonDeserializer<Object> deser = findDeserializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (deser != null) { return deser; } // If not, any type modifiers? (@JsonDeserialize.as) type = modifyTypeByAnnotation(config, beanDesc.getClassInfo(), type, null); JavaType contentType = type.getContentType(); // Very first thing: is deserializer hard-coded for elements? JsonDeserializer<Object> contentDeser = contentType.getValueHandler(); // Then optional type info (1.5): if type has been resolved, we may already know type deserializer: TypeDeserializer contentTypeDeser = contentType.getTypeHandler(); // but if not, may still be possible to find: if (contentTypeDeser == null) { contentTypeDeser = findTypeDeserializer(config, contentType, property); } return _findCustomCollectionLikeDeserializer(type, config, p, beanDesc, property, contentTypeDeser, contentDeser); }
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();
TypeDeserializer typeDeser = type.getTypeHandler(); SettableBeanProperty prop = new SettableBeanProperty.SetterlessProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), getter);
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();
TypeDeserializer typeDeser = (TypeDeserializer) type.getTypeHandler();
TypeSerializer typeSer = type.getContentType().getTypeHandler(); if (typeSer != null) {
TypeDeserializer typeDeser = type.getTypeHandler(); SettableBeanProperty prop = new SettableBeanProperty.FieldProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), field);
TypeDeserializer typeDeser = type.getTypeHandler(); SettableBeanProperty prop = new SettableBeanProperty.MethodProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), setter);
@Override public ArrayType withContentTypeHandler(Object h) { if (h == _componentType.getTypeHandler()) { return this; } return new ArrayType(_componentType.withTypeHandler(h), _emptyArray, _valueHandler, _typeHandler); }
/** * More efficient version of {@link #narrowBy}, called by * internal framework in cases where compatibility checks * are to be skipped. * * @since 1.5 */ public JavaType forcedNarrowBy(Class<?> subclass) { if (subclass == _class) { // can still optimize for simple case return this; } JavaType result = _narrow(subclass); // TODO: these checks should NOT actually be needed; above should suffice: if (_valueHandler != result.getValueHandler()) { result = result.withValueHandler(_valueHandler); } if (_typeHandler != result.getTypeHandler()) { result = result.withTypeHandler(_typeHandler); } return result; }
/** * Method that can be called to do a "narrowing" conversions; that is, * to return a type with a raw class that is assignable to the raw * class of this type. If this is not possible, an * {@link IllegalArgumentException} is thrown. * If class is same as the current raw class, instance itself is * returned. */ public JavaType narrowBy(Class<?> subclass) { // First: if same raw class, just return this instance if (subclass == _class) { return this; } // Otherwise, ensure compatibility _assertSubclass(subclass, _class); JavaType result = _narrow(subclass); // TODO: these checks should NOT actually be needed; above should suffice: if (_valueHandler != result.getValueHandler()) { result = result.withValueHandler(_valueHandler); } if (_typeHandler != result.getTypeHandler()) { result = result.withTypeHandler(_typeHandler); } return result; }
@Override public JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationConfig config, DeserializerProvider p, CollectionLikeType type, BeanProperty property) throws JsonMappingException { // First: global defaulting: type = (CollectionLikeType) mapAbstractType(config, type); Class<?> collectionClass = type.getRawClass(); BasicBeanDescription beanDesc = config.introspectClassAnnotations(collectionClass); // Explicit deserializer to use? (@JsonDeserialize.using) JsonDeserializer<Object> deser = findDeserializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (deser != null) { return deser; } // If not, any type modifiers? (@JsonDeserialize.as) type = modifyTypeByAnnotation(config, beanDesc.getClassInfo(), type, null); JavaType contentType = type.getContentType(); // Very first thing: is deserializer hard-coded for elements? JsonDeserializer<Object> contentDeser = contentType.getValueHandler(); // Then optional type info (1.5): if type has been resolved, we may already know type deserializer: TypeDeserializer contentTypeDeser = contentType.getTypeHandler(); // but if not, may still be possible to find: if (contentTypeDeser == null) { contentTypeDeser = findTypeDeserializer(config, contentType, property); } return _findCustomCollectionLikeDeserializer(type, config, p, beanDesc, property, contentTypeDeser, contentDeser); }
TypeDeserializer typeDeser = type.getTypeHandler(); SettableBeanProperty prop = new SettableBeanProperty.SetterlessProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), getter);
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();