Class MinimalClassNameIdResolver
java.lang.Object
com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver
- All Implemented Interfaces:
TypeIdResolver
,Serializable
Specialization of
ClassNameIdResolver
that instead uses a
"minimal" derivation of Class
name, using relative reference
from the base type (base class) that polymorphic value has.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
Package name of the base class, to be used for determining common prefix that can be omitted from included type id.protected final String
Same as_basePackageName
, but includes trailing dot.Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
_subTypeValidator
Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
_baseType, _typeFactory
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MinimalClassNameIdResolver
(JavaType baseType, TypeFactory typeFactory, PolymorphicTypeValidator ptv) -
Method Summary
Modifier and TypeMethodDescriptionprotected JavaType
_typeFromId
(String id, DatabindContext ctxt) static MinimalClassNameIdResolver
construct
(JavaType baseType, MapperConfig<?> config, PolymorphicTypeValidator ptv) com.fasterxml.jackson.annotation.JsonTypeInfo.Id
Accessor for mechanism that this resolver uses for determining type id from type.idFromValue
(Object value) Method called to serialize type of the type of given value as a String to include in serialized JSON content.Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
_idFrom, getDescForKnownTypeIds, idFromValueAndType, registerSubtype, typeFromId
Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
idFromBaseType, init
-
Field Details
-
_basePackageName
Package name of the base class, to be used for determining common prefix that can be omitted from included type id. Does not include the trailing dot. -
_basePackagePrefix
Same as_basePackageName
, but includes trailing dot.
-
-
Constructor Details
-
MinimalClassNameIdResolver
protected MinimalClassNameIdResolver(JavaType baseType, TypeFactory typeFactory, PolymorphicTypeValidator ptv)
-
-
Method Details
-
construct
public static MinimalClassNameIdResolver construct(JavaType baseType, MapperConfig<?> config, PolymorphicTypeValidator ptv) -
getMechanism
public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()Description copied from interface:TypeIdResolver
Accessor for mechanism that this resolver uses for determining type id from type. Mostly informational; not required to be called or used.- Specified by:
getMechanism
in interfaceTypeIdResolver
- Overrides:
getMechanism
in classClassNameIdResolver
-
idFromValue
Description copied from interface:TypeIdResolver
Method called to serialize type of the type of given value as a String to include in serialized JSON content.- Specified by:
idFromValue
in interfaceTypeIdResolver
- Overrides:
idFromValue
in classClassNameIdResolver
-
_typeFromId
- Overrides:
_typeFromId
in classClassNameIdResolver
- Throws:
IOException
-