Class JsonSchemaIdResolver
java.lang.Object
com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
com.fasterxml.jackson.module.jsonSchema.jakarta.JsonSchemaIdResolver
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsontype.TypeIdResolver
public class JsonSchemaIdResolver
extends com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
Type id resolver needed to support polymorphic (de)serialization of all kinds of
JsonSchema
instances.
Note that to support custom types, you will need to sub-class this resolver
and override at least idFromValue(Object)
, idFromValueAndType(Object, Class)
and
typeFromId(com.fasterxml.jackson.databind.DatabindContext, java.lang.String)
methods; as well as associate this resolver using
JsonTypeInfo
annotation on
all custom JsonSchema
implementation classes.-
Field Summary
Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
_baseType, _typeFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.annotation.JsonTypeInfo.Id
idFromValue
(Object value) idFromValueAndType
(Object value, Class<?> suggestedType) void
init
(com.fasterxml.jackson.databind.JavaType baseType) com.fasterxml.jackson.databind.JavaType
typeFromId
(com.fasterxml.jackson.databind.DatabindContext ctxt, String id) Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
getDescForKnownTypeIds
-
Constructor Details
-
JsonSchemaIdResolver
public JsonSchemaIdResolver()
-
-
Method Details
-
idFromValue
-
idFromValueAndType
-
typeFromId
public com.fasterxml.jackson.databind.JavaType typeFromId(com.fasterxml.jackson.databind.DatabindContext ctxt, String id) - Specified by:
typeFromId
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
- Overrides:
typeFromId
in classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-
getMechanism
public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism() -
init
public void init(com.fasterxml.jackson.databind.JavaType baseType) - Specified by:
init
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
- Overrides:
init
in classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-
idFromBaseType
- Specified by:
idFromBaseType
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
- Overrides:
idFromBaseType
in classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-