Class TypeIdResolverBase
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
- All Implemented Interfaces:
TypeIdResolver
- Direct Known Subclasses:
ClassNameIdResolver
,TypeNameIdResolver
Partial base implementation of
TypeIdResolver
: all custom implementations
are strongly recommended to extend this class, instead of directly
implementing TypeIdResolver
.
Note that ALL sub-class need to re-implement
typeFromId(DatabindContext, String)
method; otherwise implementation
will not work.
Note that instances created to be constructed from annotations
(JsonTypeIdResolver
)
are always created using no-arguments constructor; protected constructor
is only used sub-classes.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final JavaType
Common base type for all polymorphic instances handled.protected final TypeFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
TypeIdResolverBase
(JavaType baseType, TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionHelper method used to get a simple description of all known type ids, for use in error messages.Method that can be called to figure out type id to use for instances of base type (declared type of property).void
Method that will be called once before any type resolution calls; used to initialize instance with configuration.typeFromId
(DatabindContext context, String id) Method called to resolve type from given type identifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.jsontype.TypeIdResolver
getMechanism, idFromValue, idFromValueAndType
-
Field Details
-
_typeFactory
-
_baseType
Common base type for all polymorphic instances handled.
-
-
Constructor Details
-
TypeIdResolverBase
protected TypeIdResolverBase() -
TypeIdResolverBase
-
-
Method Details
-
init
Description copied from interface:TypeIdResolver
Method that will be called once before any type resolution calls; used to initialize instance with configuration. This is necessary since instances may be created via reflection, without ability to call specific constructor to pass in configuration settings.- Specified by:
init
in interfaceTypeIdResolver
- Parameters:
bt
- Base type for which this id resolver instance is used
-
idFromBaseType
Description copied from interface:TypeIdResolver
Method that can be called to figure out type id to use for instances of base type (declared type of property). This is usually only used for fallback handling, for cases where real type information is not available for some reason.- Specified by:
idFromBaseType
in interfaceTypeIdResolver
-
typeFromId
Description copied from interface:TypeIdResolver
Method called to resolve type from given type identifier.- Specified by:
typeFromId
in interfaceTypeIdResolver
- Throws:
IOException
-
getDescForKnownTypeIds
Helper method used to get a simple description of all known type ids, for use in error messages.- Specified by:
getDescForKnownTypeIds
in interfaceTypeIdResolver
-