|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeIdResolver
Interface that defines standard API for converting types
to type identifiers and vice versa. Used by type resolvers
(TypeSerializer
,
TypeDeserializer
) for converting
between type and matching id; id is stored in JSON and needed for
creating instances of proper subtypes when deserializing values.
Method Summary | |
---|---|
com.fasterxml.jackson.annotation.JsonTypeInfo.Id |
getMechanism()
Accessor for mechanism that this resolver uses for determining type id from type. |
String |
idFromBaseType()
Method that can be called to figure out type id to use for instances of base type (declared type of property). |
String |
idFromValue(Object value)
Method called to serialize type of the type of given value as a String to include in serialized JSON content. |
String |
idFromValueAndType(Object value,
Class<?> suggestedType)
Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type. |
void |
init(JavaType baseType)
Method that will be called once before any type resolution calls; used to initialize instance with configuration. |
JavaType |
typeFromId(String id)
Method called to resolve type from given type identifier. |
Method Detail |
---|
void init(JavaType baseType)
baseType
- Base type for which this id resolver instance is
usedString idFromValue(Object value)
String idFromValueAndType(Object value, Class<?> suggestedType)
String idFromBaseType()
JavaType typeFromId(String id)
com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |