Class StdTypeResolverBuilder
java.lang.Object
org.codehaus.jackson.map.jsontype.impl.StdTypeResolverBuilder
- All Implemented Interfaces:
TypeResolverBuilder<StdTypeResolverBuilder>
- Direct Known Subclasses:
ObjectMapper.DefaultTypeResolverBuilder
public class StdTypeResolverBuilder
extends Object
implements TypeResolverBuilder<StdTypeResolverBuilder>
Default
TypeResolverBuilder implementation.- Since:
- 1.5
- Author:
- tatu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TypeIdResolverprotected Class<?> protected JsonTypeInfo.Idprotected JsonTypeInfo.Asprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property) Method for building type deserializer based on current configuration of this builder.buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property) Method for building type serializer based on current configuration of this builder.defaultImpl(Class<?> defaultImpl) Method for specifying default implementation to use if type id is either not available, or can not be resolved.Class<?> Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolutionprotected TypeIdResolveridResolver(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.inclusion(JsonTypeInfo.As includeAs) Method for specifying mechanism to use for including type metadata in JSON.init(JsonTypeInfo.Id idType, TypeIdResolver idRes) Initialization method that is called right after constructing the builder instance.static StdTypeResolverBuildertypeProperty(String typeIdPropName) Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).
-
Field Details
-
_idType
-
_includeAs
-
_typeProperty
-
_defaultImpl
- Since:
- 1.9
-
_customIdResolver
-
-
Constructor Details
-
StdTypeResolverBuilder
public StdTypeResolverBuilder()
-
-
Method Details
-
getDefaultImpl
Description copied from interface:TypeResolverBuilderAccessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution- Specified by:
getDefaultImplin interfaceTypeResolverBuilder<StdTypeResolverBuilder>
-
noTypeInfoBuilder
-
init
Description copied from interface:TypeResolverBuilderInitialization method that is called right after constructing the builder instance.- Specified by:
initin interfaceTypeResolverBuilder<StdTypeResolverBuilder>- Parameters:
idType- Which type metadata is usedidRes- (optional) Custom type id resolver used, if any- Returns:
- Resulting builder instance (usually this builder, but not necessarily)
-
buildTypeSerializer
public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property) Description copied from interface:TypeResolverBuilderMethod for building type serializer based on current configuration of this builder.- Specified by:
buildTypeSerializerin interfaceTypeResolverBuilder<StdTypeResolverBuilder>- Parameters:
baseType- Base type that constructed resolver will handle; super type of all types it will be used for.
-
buildTypeDeserializer
public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes, BeanProperty property) Description copied from interface:TypeResolverBuilderMethod for building type deserializer based on current configuration of this builder.- Specified by:
buildTypeDeserializerin interfaceTypeResolverBuilder<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.
-
inclusion
Description copied from interface:TypeResolverBuilderMethod for specifying mechanism to use for including type metadata in JSON. If not explicitly called, setting defaults toJsonTypeInfo.As.PROPERTY.- Specified by:
inclusionin interfaceTypeResolverBuilder<StdTypeResolverBuilder>- Parameters:
includeAs- Mechanism used for including type metadata in JSON- Returns:
- Resulting builder instance (usually this builder, but not necessarily)
-
typeProperty
Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).- Specified by:
typePropertyin interfaceTypeResolverBuilder<StdTypeResolverBuilder>- Parameters:
typeIdPropName- Name of JSON property to use for including type information- Returns:
- Resulting builder instance (usually this builder, but not necessarily)
-
defaultImpl
Description copied from interface:TypeResolverBuilderMethod for specifying default implementation to use if type id is either not available, or can not be resolved.- Specified by:
defaultImplin interfaceTypeResolverBuilder<StdTypeResolverBuilder>
-
getTypeProperty
-
idResolver
protected TypeIdResolver idResolver(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.
-