Package org.codehaus.jackson.map
Class ObjectMapper.DefaultTypeResolverBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.jsontype.impl.StdTypeResolverBuilder
-
- org.codehaus.jackson.map.ObjectMapper.DefaultTypeResolverBuilder
-
- All Implemented Interfaces:
TypeResolverBuilder<StdTypeResolverBuilder>
- Enclosing class:
- ObjectMapper
public static class ObjectMapper.DefaultTypeResolverBuilder extends StdTypeResolverBuilder
CustomizedTypeResolverBuilder
that provides type resolver builders used with so-called "default typing" (seeObjectMapper.enableDefaultTyping()
for details).Type resolver construction is based on configuration: implementation takes care of only providing builders in cases where type information should be applied. This is important since build calls may be sent for any and all types, and type information should NOT be applied to all of them.
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectMapper.DefaultTyping
_appliesFor
Definition of what types is this default typer valid for.-
Fields inherited from class org.codehaus.jackson.map.jsontype.impl.StdTypeResolverBuilder
_customIdResolver, _defaultImpl, _idType, _includeAs, _typeProperty
-
-
Constructor Summary
Constructors Constructor Description DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDeserializer
buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property)
Method for building type deserializer based on current configuration of this builder.TypeSerializer
buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property)
Method for building type serializer based on current configuration of this builder.boolean
useForType(JavaType t)
Method called to check if the default type handler should be used for given type.-
Methods inherited from class org.codehaus.jackson.map.jsontype.impl.StdTypeResolverBuilder
defaultImpl, getDefaultImpl, getTypeProperty, idResolver, inclusion, init, typeProperty
-
-
-
-
Field Detail
-
_appliesFor
protected final ObjectMapper.DefaultTyping _appliesFor
Definition of what types is this default typer valid for.
-
-
Constructor Detail
-
DefaultTypeResolverBuilder
public DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
-
-
Method Detail
-
buildTypeDeserializer
public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property)
Description copied from interface:TypeResolverBuilder
Method for building type deserializer based on current configuration of this builder.- Specified by:
buildTypeDeserializer
in interfaceTypeResolverBuilder<StdTypeResolverBuilder>
- Overrides:
buildTypeDeserializer
in classStdTypeResolverBuilder
baseType
- Base type that constructed resolver will handle; super type of all types it will be used for.subtypes
- Known subtypes of the base type.
-
buildTypeSerializer
public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property)
Description copied from interface:TypeResolverBuilder
Method for building type serializer based on current configuration of this builder.- Specified by:
buildTypeSerializer
in interfaceTypeResolverBuilder<StdTypeResolverBuilder>
- Overrides:
buildTypeSerializer
in classStdTypeResolverBuilder
baseType
- Base type that constructed resolver will handle; super type of all types it will be used for.
-
useForType
public boolean useForType(JavaType t)
Method called to check if the default type handler should be used for given type. Note: "natural types" (String, Boolean, Integer, Double) will never use typing; that is both due to them being concrete and final, and since actual serializers and deserializers will also ignore any attempts to enforce typing.
-
-