@Override public ArrayType withContentValueHandler(Object h) { if (h == _componentType.getValueHandler()) { return this; } return new ArrayType(_componentType.withValueHandler(h), _emptyArray, _valueHandler, _typeHandler); }
Object h = baseType.getValueHandler(); if (h != null) {
/** * 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; }
JsonDeserializer<Object> contentDeser = elemType.getValueHandler(); if (contentDeser == null) {
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler(); KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler(); if (keyDes == null) { keyDes = p.findKeyDeserializer(config, keyType, property);
if (keyType != null && keyType.getValueHandler() == null) { Class<? extends KeyDeserializer> kdClass = intr.findKeyDeserializer(a); if (kdClass != null && kdClass != KeyDeserializer.None.class) { if (contentType.getValueHandler() == null) { // as with above, avoid resetting (which would trigger exception) Class<? extends JsonDeserializer<?>> cdClass = intr.findContentDeserializer(a); if (cdClass != null && cdClass != JsonDeserializer.None.class) {
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler(); KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler(); if (keyDes == null) { keyDes = p.findKeyDeserializer(config, keyType, property);
JsonDeserializer<Object> contentDeser = contentType.getValueHandler();
@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); }
@Override public ArrayType withContentValueHandler(Object h) { if (h == _componentType.getValueHandler()) { return this; } return new ArrayType(_componentType.withValueHandler(h), _emptyArray, _valueHandler, _typeHandler); }
Object h = baseType.getValueHandler(); if (h != null) {
/** * 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; }
JsonDeserializer<Object> contentDeser = elemType.getValueHandler(); if (contentDeser == null) {
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler(); KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler(); if (keyDes == null) { keyDes = p.findKeyDeserializer(config, keyType, property);
if (keyType != null && keyType.getValueHandler() == null) { Class<? extends KeyDeserializer> kdClass = intr.findKeyDeserializer(a); if (kdClass != null && kdClass != KeyDeserializer.None.class) { if (contentType.getValueHandler() == null) { // as with above, avoid resetting (which would trigger exception) Class<? extends JsonDeserializer<?>> cdClass = intr.findContentDeserializer(a); if (cdClass != null && cdClass != JsonDeserializer.None.class) {
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler(); KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler(); if (keyDes == null) { keyDes = p.findKeyDeserializer(config, keyType, property);
JsonDeserializer<Object> contentDeser = contentType.getValueHandler();
@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); }