public class StdTypeResolverBuilder extends java.lang.Object implements TypeResolverBuilder<StdTypeResolverBuilder>
TypeResolverBuilder implementation.| Constructor and Description |
|---|
StdTypeResolverBuilder() |
StdTypeResolverBuilder(JsonTypeInfo.Value settings) |
| Modifier and Type | Method and Description |
|---|---|
TypeDeserializer |
buildTypeDeserializer(DeserializationConfig config,
JavaType baseType,
java.util.Collection<NamedType> subtypes)
Method for building type deserializer based on current configuration
of this builder.
|
TypeSerializer |
buildTypeSerializer(SerializationConfig config,
JavaType baseType,
java.util.Collection<NamedType> subtypes)
Method for building type serializer based on current configuration
of this builder.
|
StdTypeResolverBuilder |
defaultImpl(java.lang.Class<?> defaultImpl)
Method for specifying default implementation to use if type id
is either not available, or cannot be resolved.
|
java.lang.Class<?> |
getDefaultImpl()
Accessor for currently configured default type; implementation
class that may be used in case no valid type information is
available during type resolution
|
java.lang.String |
getTypeProperty() |
StdTypeResolverBuilder |
inclusion(JsonTypeInfo.As includeAs)
Method for specifying mechanism to use for including type metadata
in JSON.
|
StdTypeResolverBuilder |
init(JsonTypeInfo.Id idType,
TypeIdResolver idRes)
Initialization method that is called right after constructing
the builder instance.
|
StdTypeResolverBuilder |
init(JsonTypeInfo.Value settings,
TypeIdResolver idRes)
Initialization method that is called right after constructing
the builder instance, in cases where information could not be
passed directly (for example when instantiated for an annotation)
|
boolean |
isTypeIdVisible() |
static StdTypeResolverBuilder |
noTypeInfoBuilder() |
PolymorphicTypeValidator |
subTypeValidator(MapperConfig<?> config)
Overridable helper method for determining actual validator to use when constructing
type serializers and type deserializers.
|
StdTypeResolverBuilder |
typeIdVisibility(boolean isVisible)
Method for specifying whether type id should be visible to
JsonDeserializers or not. |
StdTypeResolverBuilder |
typeProperty(java.lang.String typeIdPropName)
Method for constructing an instance with specified type property name
(property name to use for type id when using "as-property" inclusion).
|
StdTypeResolverBuilder |
withDefaultImpl(java.lang.Class<?> defaultImpl)
"Mutant factory" method for creating a new instance with different default
implementation.
|
StdTypeResolverBuilder |
withSettings(JsonTypeInfo.Value settings)
Method for overriding type information.
|
public StdTypeResolverBuilder()
public StdTypeResolverBuilder(JsonTypeInfo.Value settings)
public static StdTypeResolverBuilder noTypeInfoBuilder()
public StdTypeResolverBuilder init(JsonTypeInfo.Id idType, TypeIdResolver idRes)
TypeResolverBuilderinit in interface TypeResolverBuilder<StdTypeResolverBuilder>idType - Which type metadata is usedidRes - (optional) Custom type id resolver used, if anypublic StdTypeResolverBuilder init(JsonTypeInfo.Value settings, TypeIdResolver idRes)
TypeResolverBuilderNOTE: This method is abstract in Jackson 3.0, at the moment of writing.
init in interface TypeResolverBuilder<StdTypeResolverBuilder>settings - Configuration settings to apply.public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, java.util.Collection<NamedType> subtypes)
TypeResolverBuilderbuildTypeSerializer in interface TypeResolverBuilder<StdTypeResolverBuilder>baseType - Base type that constructed resolver will
handle; super type of all types it will be used for.public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, java.util.Collection<NamedType> subtypes)
TypeResolverBuilderbuildTypeDeserializer in interface TypeResolverBuilder<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 StdTypeResolverBuilder inclusion(JsonTypeInfo.As includeAs)
TypeResolverBuilderJsonTypeInfo.As.PROPERTY.inclusion in interface TypeResolverBuilder<StdTypeResolverBuilder>includeAs - Mechanism used for including type metadata in JSONpublic StdTypeResolverBuilder typeProperty(java.lang.String typeIdPropName)
typeProperty in interface TypeResolverBuilder<StdTypeResolverBuilder>typeIdPropName - Name of JSON property to use for including
type informationpublic StdTypeResolverBuilder defaultImpl(java.lang.Class<?> defaultImpl)
TypeResolverBuilderdefaultImpl in interface TypeResolverBuilder<StdTypeResolverBuilder>public StdTypeResolverBuilder typeIdVisibility(boolean isVisible)
TypeResolverBuilderJsonDeserializers or not.typeIdVisibility in interface TypeResolverBuilder<StdTypeResolverBuilder>public StdTypeResolverBuilder withDefaultImpl(java.lang.Class<?> defaultImpl)
TypeResolverBuilderwithDefaultImpl in interface TypeResolverBuilder<StdTypeResolverBuilder>public StdTypeResolverBuilder withSettings(JsonTypeInfo.Value settings)
TypeResolverBuilderwithSettings in interface TypeResolverBuilder<StdTypeResolverBuilder>public java.lang.Class<?> getDefaultImpl()
TypeResolverBuildergetDefaultImpl in interface TypeResolverBuilder<StdTypeResolverBuilder>public java.lang.String getTypeProperty()
public boolean isTypeIdVisible()
public PolymorphicTypeValidator subTypeValidator(MapperConfig<?> config)
Default implementation simply uses one configured and accessible using
MapperConfig.getPolymorphicTypeValidator().
Copyright © 2010 - 2024 Adobe. All Rights Reserved