org.codehaus.jackson.map
Class ObjectMapper.DefaultTypeResolverBuilder

java.lang.Object
  extended by org.codehaus.jackson.map.jsontype.impl.StdTypeResolverBuilder
      extended by org.codehaus.jackson.map.ObjectMapper.DefaultTypeResolverBuilder
All Implemented Interfaces:
TypeResolverBuilder<StdTypeResolverBuilder>
Enclosing class:
ObjectMapper

public static class ObjectMapper.DefaultTypeResolverBuilder
extends StdTypeResolverBuilder

Customized TypeResolverBuilder that provides resolver builders based on its configuration. It is used when default typing is enabled (see ObjectMapper.enableDefaultTyping() for details).


Field Summary
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, _idType, _includeAs, _typeProperty
 
Constructor Summary
ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
           
 
Method Summary
 TypeDeserializer buildTypeDeserializer(JavaType baseType, Collection<NamedType> subtypes)
          Method for building type deserializer based on current configuration of this builder.
 TypeSerializer buildTypeSerializer(JavaType baseType, Collection<NamedType> subtypes)
          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
idResolver, inclusion, init, typeProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_appliesFor

protected final ObjectMapper.DefaultTyping _appliesFor
Definition of what types is this default typer valid for.

Constructor Detail

ObjectMapper.DefaultTypeResolverBuilder

public ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
Method Detail

buildTypeDeserializer

public TypeDeserializer buildTypeDeserializer(JavaType baseType,
                                              Collection<NamedType> subtypes)
Description copied from interface: TypeResolverBuilder
Method for building type deserializer based on current configuration of this builder.

Specified by:
buildTypeDeserializer in interface TypeResolverBuilder<StdTypeResolverBuilder>
Overrides:
buildTypeDeserializer in class StdTypeResolverBuilder
Parameters:
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(JavaType baseType,
                                          Collection<NamedType> subtypes)
Description copied from interface: TypeResolverBuilder
Method for building type serializer based on current configuration of this builder.

Specified by:
buildTypeSerializer in interface TypeResolverBuilder<StdTypeResolverBuilder>
Overrides:
buildTypeSerializer in class StdTypeResolverBuilder
Parameters:
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.