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,java.io.Serializable
public class MinimalClassNameIdResolver extends ClassNameIdResolver
Specialization ofClassNameIdResolverthat instead uses a "minimal" derivation ofClassname, using relative reference from the base type (base class) that polymorphic value has.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MinimalClassNameIdResolverconstruct(JavaType baseType, MapperConfig<?> config, PolymorphicTypeValidator ptv)Deprecated.since 2.19static MinimalClassNameIdResolverconstruct(JavaType baseType, MapperConfig<?> config, java.util.Collection<NamedType> subtypes, PolymorphicTypeValidator ptv)JsonTypeInfo.IdgetMechanism()Accessor for mechanism that this resolver uses for determining type id from type.java.lang.StringidFromValue(java.lang.Object value)Method called to serialize type of the type of given value as a String to include in serialized JSON content.java.lang.StringidFromValueAndType(java.lang.Object value, java.lang.Class<?> rawType)Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type.-
Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
getDescForKnownTypeIds, registerSubtype, typeFromId
-
Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
idFromBaseType, init
-
-
-
-
Method Detail
-
construct
@Deprecated public static MinimalClassNameIdResolver construct(JavaType baseType, MapperConfig<?> config, PolymorphicTypeValidator ptv)
Deprecated.since 2.19
-
construct
public static MinimalClassNameIdResolver construct(JavaType baseType, MapperConfig<?> config, java.util.Collection<NamedType> subtypes, PolymorphicTypeValidator ptv)
- Since:
- 2.19
-
getMechanism
public JsonTypeInfo.Id getMechanism()
Description copied from interface:TypeIdResolverAccessor for mechanism that this resolver uses for determining type id from type. Mostly informational; not required to be called or used.- Specified by:
getMechanismin interfaceTypeIdResolver- Overrides:
getMechanismin classClassNameIdResolver
-
idFromValue
public java.lang.String idFromValue(java.lang.Object value)
Description copied from interface:TypeIdResolverMethod called to serialize type of the type of given value as a String to include in serialized JSON content.- Specified by:
idFromValuein interfaceTypeIdResolver- Overrides:
idFromValuein classClassNameIdResolver
-
idFromValueAndType
public java.lang.String idFromValueAndType(java.lang.Object value, java.lang.Class<?> rawType)Description copied from interface:TypeIdResolverAlternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type. Most common implementation will use suggested type as is.- Specified by:
idFromValueAndTypein interfaceTypeIdResolver- Overrides:
idFromValueAndTypein classClassNameIdResolver
-
-