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(DatabindContext, 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.IdidFromValue(Object value) idFromValueAndType(Object value, Class<?> suggestedType) voidinit(com.fasterxml.jackson.databind.JavaType baseType) com.fasterxml.jackson.databind.JavaTypetypeFromId(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:
typeFromIdin interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver- Overrides:
typeFromIdin 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:
initin interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver- Overrides:
initin classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-
idFromBaseType
- Specified by:
idFromBaseTypein interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver- Overrides:
idFromBaseTypein classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-