public static void enableDefaultTyping(ObjectMapper mapper) { if (mapper != null) { TypeResolverBuilder<?> typeBuilder = mapper.getDeserializationConfig().getDefaultTyper(null); if (typeBuilder == null) { mapper.setDefaultTyping(createWhitelistedDefaultTyping()); } } }
public static void enableDefaultTyping(ObjectMapper mapper) { if (mapper != null) { TypeResolverBuilder<?> typeBuilder = mapper.getDeserializationConfig().getDefaultTyper(null); if (typeBuilder == null) { mapper.setDefaultTyping(createWhitelistedDefaultTyping()); } } }
/** * Helper method that is needed to properly handle polymorphic referenced * types, such as types referenced by {@link java.util.concurrent.atomic.AtomicReference}, * or various "optional" types. * * @since 2.4 */ public TypeDeserializer findTypeDeserializer(JavaType baseType) throws JsonMappingException { BeanDescription bean = introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); TypeResolverBuilder<?> b = getAnnotationIntrospector().findTypeResolver(this, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = getDefaultTyper(baseType); if (b == null) { return null; } } else { subtypes = getSubtypeResolver().collectAndResolveSubtypesByTypeId(this, ac); } return b.buildTypeDeserializer(this, baseType, subtypes); } }
b = config.getDefaultTyper(baseType); if (b == null) { return null;
public static void enableDefaultTyping(ObjectMapper mapper) { if (mapper != null) { TypeResolverBuilder<?> typeBuilder = mapper.getDeserializationConfig().getDefaultTyper(null); if (typeBuilder == null) { mapper.setDefaultTyping(createWhitelistedDefaultTyping()); } } }
/** * Helper method that is needed to properly handle polymorphic referenced * types, such as types referenced by {@link java.util.concurrent.atomic.AtomicReference}, * or various "optional" types. * * @since 2.4 */ public TypeDeserializer findTypeDeserializer(JavaType baseType) throws JsonMappingException { BeanDescription bean = introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); TypeResolverBuilder<?> b = getAnnotationIntrospector().findTypeResolver(this, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = getDefaultTyper(baseType); if (b == null) { return null; } } else { subtypes = getSubtypeResolver().collectAndResolveSubtypesByTypeId(this, ac); } return b.buildTypeDeserializer(this, baseType, subtypes); } }
b = getDefaultTyper(baseType); if (b == null) { return null;
b = getDefaultTyper(baseType); if (b == null) { return null;
b = getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;
b = config.getDefaultTyper(baseType); if (b == null) { return null;