public TypeFactory getTypeFactory() { return _config.getTypeFactory(); }
@Override public final TypeFactory getTypeFactory() { return _config.getTypeFactory(); }
/** * @deprecated since 2.5 Use {@link #forType(Class)} instead */ @Deprecated public ObjectReader withType(java.lang.reflect.Type valueType) { return forType(_config.getTypeFactory().constructType(valueType)); }
/** * @deprecated since 2.5 Use {@link #forType(TypeReference)} instead */ @Deprecated public ObjectReader withType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 2.5 */ public ObjectReader forType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
@Override public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType != JsonTypeInfo.Id.CUSTOM || _includeAs != JsonTypeInfo.As.WRAPPER_OBJECT) { return super.buildTypeDeserializer(config, baseType, subtypes); } final TypeIdResolver idRes = new ValueReferenceTypeIdResolver(baseType, config.getTypeFactory(), subtypes); final JavaType defaultImpl; if (_defaultImpl == null) { defaultImpl = null; } else { if ((_defaultImpl == Void.class) || (_defaultImpl == NoClass.class)) { defaultImpl = config.getTypeFactory().constructType(_defaultImpl); } else { defaultImpl = config.getTypeFactory().constructSpecializedType(baseType, _defaultImpl); } } return new AsValueReferenceTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl); }
@Override public JavaType findTypeMapping(DeserializationConfig config, JavaType type) { // this is the main mapping base, so let's Class<?> src = type.getRawClass(); Class<?> dst = _mappings.get(new ClassKey(src)); if (dst == null) { return null; } // 09-Aug-2015, tatu: Instead of direct call via JavaType, better use TypeFactory return config.getTypeFactory().constructSpecializedType(type, dst); }
defaultImpl = config.getTypeFactory().constructType(_defaultImpl); } else { if (baseType.hasRawClass(_defaultImpl)) { // common enough to check } else if (baseType.isTypeOrSuperTypeOf(_defaultImpl)) { defaultImpl = config.getTypeFactory() .constructSpecializedType(baseType, _defaultImpl); } else {
defaultImpl = config.getTypeFactory().constructType(_defaultImpl); } else { defaultImpl = config.getTypeFactory() .constructSpecializedType(baseType, _defaultImpl);
private static JsonDeserializer<?> wrapIfCollection(PersistentProperty<?> property, JsonDeserializer<Object> elementDeserializer, DeserializationConfig config) { if (!property.isCollectionLike()) { return elementDeserializer; } CollectionLikeType collectionType = config.getTypeFactory().constructCollectionLikeType(property.getType(), property.getActualType()); CollectionValueInstantiator instantiator = new CollectionValueInstantiator(property); return new CollectionDeserializer(collectionType, elementDeserializer, null, instantiator); } }
/** * Convenience method, functionally equivalent to: *<pre> * getConfig().getTypeFactory(); * </pre> */ public final TypeFactory getTypeFactory() { return _config.getTypeFactory(); }
/** * @deprecated since 2.5 Use {@link #forType(Class)} instead */ @Deprecated public ObjectReader withType(java.lang.reflect.Type valueType) { return forType(_config.getTypeFactory().constructType(valueType)); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withType(java.lang.reflect.Type valueType) { return withType(_config.getTypeFactory().constructType(valueType)); }
/** * @deprecated since 2.5 Use {@link #forType(TypeReference)} instead */ @Deprecated public ObjectReader withType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withType(TypeReference<?> valueTypeRef) { return withType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 2.5 */ public ObjectReader forType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 2.5 */ public ObjectReader forType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 2.5 */ public ObjectReader forType(TypeReference<?> valueTypeRef) { return forType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
@Override public JavaType findTypeMapping(DeserializationConfig config, JavaType type) { // this is the main mapping base, so let's Class<?> src = type.getRawClass(); Class<?> dst = _mappings.get(new ClassKey(src)); if (dst == null) { return null; } // 09-Aug-2015, tatu: Instead of direct call via JavaType, better use TypeFactory return config.getTypeFactory().constructSpecializedType(type, dst); }
private static JsonDeserializer<?> wrapIfCollection(PersistentProperty<?> property, JsonDeserializer<Object> elementDeserializer, DeserializationConfig config) { if (!property.isCollectionLike()) { return elementDeserializer; } CollectionLikeType collectionType = config.getTypeFactory().constructCollectionLikeType(property.getType(), property.getActualType()); CollectionValueInstantiator instantiator = new CollectionValueInstantiator(property); return new CollectionDeserializer(collectionType, elementDeserializer, null, instantiator); } }