Class TypeNameIdResolver
java.lang.Object
org.codehaus.jackson.map.jsontype.impl.TypeIdResolverBase
org.codehaus.jackson.map.jsontype.impl.TypeNameIdResolver
- All Implemented Interfaces:
TypeIdResolver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MapperConfig<?> Mappings from type id to JavaType, used for deserializationMappings from class name to type id, used for serializationFields inherited from class TypeIdResolverBase
_baseType, _typeFactory -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeNameIdResolver(MapperConfig<?> config, JavaType baseType, HashMap<String, String> typeToId, HashMap<String, JavaType> idToType) -
Method Summary
Modifier and TypeMethodDescriptionprotected static String_defaultTypeId(Class<?> cls) If no name was explicitly given for a class, we will just use non-qualified class namestatic TypeNameIdResolverconstruct(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) Accessor for mechanism that this resolver uses for determining type id from type.idFromValue(Object value) Method called to serialize type of the type of given value as a String to include in serialized JSON content.idFromValueAndType(Object value, Class<?> type) Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type.toString()typeFromId(String id) Method called to resolve type from given type identifier.Methods inherited from class TypeIdResolverBase
idFromBaseType, init
-
Field Details
-
_config
- Since:
- 1.8
-
_typeToId
-
_idToType
-
-
Constructor Details
-
TypeNameIdResolver
-
-
Method Details
-
construct
public static TypeNameIdResolver construct(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) -
getMechanism
Description copied from interface:TypeIdResolverAccessor for mechanism that this resolver uses for determining type id from type. Mostly informational; not required to be called or used. -
idFromValue
Description copied from interface:TypeIdResolverMethod called to serialize type of the type of given value as a String to include in serialized JSON content. -
idFromValueAndType
Description copied from interface:TypeIdResolverAlternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type. Most common implementation will use suggested type as is. -
typeFromId
Description copied from interface:TypeIdResolverMethod called to resolve type from given type identifier.- Throws:
IllegalArgumentException
-
toString
-
_defaultTypeId
-