Package org.apache.druid.jackson
Class StrictTypeIdResolver
java.lang.Object
com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
org.apache.druid.jackson.StrictTypeIdResolver
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsontype.TypeIdResolver
public class StrictTypeIdResolver
extends com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
A strict
TypeIdResolver implementation that validates all incoming type ids.
During deserialization, the type discriminator in the JSON must correspond to a registered subtype; otherwise this resolver will throw an exception instead of silently accepting or defaulting.
An optional default implementation may still be configured and used only when the type id is absent.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.JavaTypeprotected final com.fasterxml.jackson.databind.jsontype.impl.TypeNameIdResolverFields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
_baseType, _typeFactory -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.annotation.JsonTypeInfo.IdidFromValue(Object value) idFromValueAndType(Object value, Class<?> suggestedType) com.fasterxml.jackson.databind.JavaTypetypeFromId(com.fasterxml.jackson.databind.DatabindContext context, String id) Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
_resolveToParentAsNecessary, idFromBaseType, init
-
Field Details
-
baseType
protected final com.fasterxml.jackson.databind.JavaType baseType -
delegate
protected final com.fasterxml.jackson.databind.jsontype.impl.TypeNameIdResolver delegate
-
-
Method Details
-
typeFromId
public com.fasterxml.jackson.databind.JavaType typeFromId(com.fasterxml.jackson.databind.DatabindContext context, String id) throws com.fasterxml.jackson.core.JsonProcessingException - Specified by:
typeFromIdin interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver- Overrides:
typeFromIdin classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
idFromValue
-
idFromValueAndType
-
getDescForKnownTypeIds
- Specified by:
getDescForKnownTypeIdsin interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver- Overrides:
getDescForKnownTypeIdsin classcom.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
-
getMechanism
public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()
-