public static class ObjectMapper.DefaultTypeResolverBuilder extends StdTypeResolverBuilder implements Serializable
TypeResolverBuilder
that provides type resolver builders
used with so-called "default typing"
(see ObjectMapper.activateDefaultTyping(PolymorphicTypeValidator)
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.
Modifier and Type | Field and Description |
---|---|
protected ObjectMapper.DefaultTyping |
_appliesFor
Definition of what types is this default typer valid for.
|
protected PolymorphicTypeValidator |
_subtypeValidator
PolymorphicTypeValidator top use for validating that the subtypes
resolved are valid for use (usually to protect against possible
security issues) |
_customIdResolver, _defaultImpl, _idType, _includeAs, _typeIdVisible, _typeProperty
Modifier | Constructor and Description |
---|---|
protected |
DefaultTypeResolverBuilder(ObjectMapper.DefaultTypeResolverBuilder base,
Class<?> defaultImpl) |
|
DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
Deprecated.
Since 2.10
|
|
DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t,
PolymorphicTypeValidator ptv) |
Modifier and Type | Method and Description |
---|---|
TypeDeserializer |
buildTypeDeserializer(DeserializationConfig config,
JavaType baseType,
Collection<NamedType> subtypes)
Method for building type deserializer based on current configuration
of this builder.
|
TypeSerializer |
buildTypeSerializer(SerializationConfig config,
JavaType baseType,
Collection<NamedType> subtypes)
Method for building type serializer based on current configuration
of this builder.
|
static ObjectMapper.DefaultTypeResolverBuilder |
construct(ObjectMapper.DefaultTyping t,
PolymorphicTypeValidator ptv) |
PolymorphicTypeValidator |
subTypeValidator(MapperConfig<?> config)
Overridable helper method for determining actual validator to use when constructing
type serializers and type deserializers.
|
boolean |
useForType(JavaType t)
Method called to check if the default type handler should be
used for given type.
|
ObjectMapper.DefaultTypeResolverBuilder |
withDefaultImpl(Class<?> defaultImpl)
"Mutant factory" method for creating a new instance with different default
implementation.
|
allowPrimitiveTypes, defaultImpl, defineDefaultImpl, getDefaultImpl, getTypeProperty, idResolver, inclusion, init, isTypeIdVisible, noTypeInfoBuilder, reportInvalidBaseType, typeIdVisibility, typeProperty, verifyBaseTypeValidity
protected final ObjectMapper.DefaultTyping _appliesFor
protected final PolymorphicTypeValidator _subtypeValidator
PolymorphicTypeValidator
top use for validating that the subtypes
resolved are valid for use (usually to protect against possible
security issues)@Deprecated public DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t)
public DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping t, PolymorphicTypeValidator ptv)
protected DefaultTypeResolverBuilder(ObjectMapper.DefaultTypeResolverBuilder base, Class<?> defaultImpl)
public static ObjectMapper.DefaultTypeResolverBuilder construct(ObjectMapper.DefaultTyping t, PolymorphicTypeValidator ptv)
public ObjectMapper.DefaultTypeResolverBuilder withDefaultImpl(Class<?> defaultImpl)
TypeResolverBuilder
withDefaultImpl
in interface TypeResolverBuilder<StdTypeResolverBuilder>
withDefaultImpl
in class StdTypeResolverBuilder
public PolymorphicTypeValidator subTypeValidator(MapperConfig<?> config)
StdTypeResolverBuilder
Default implementation simply uses one configured and accessible using
MapperConfig.getPolymorphicTypeValidator()
.
subTypeValidator
in class StdTypeResolverBuilder
public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes)
TypeResolverBuilder
buildTypeDeserializer
in interface TypeResolverBuilder<StdTypeResolverBuilder>
buildTypeDeserializer
in class StdTypeResolverBuilder
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.public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes)
TypeResolverBuilder
buildTypeSerializer
in interface TypeResolverBuilder<StdTypeResolverBuilder>
buildTypeSerializer
in class StdTypeResolverBuilder
baseType
- Base type that constructed resolver will
handle; super type of all types it will be used for.public boolean useForType(JavaType t)
Copyright © 2008–2022 FasterXML. All rights reserved.