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 org.codehaus.jackson.map.jsontype.impl.TypeIdResolverBase
_baseType, _typeFactory
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TypeNameIdResolver
(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 TypeNameIdResolver
construct
(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 org.codehaus.jackson.map.jsontype.impl.TypeIdResolverBase
idFromBaseType, init
-
Field Details
-
_config
- Since:
- 1.8
-
_typeToId
Mappings from class name to type id, used for serialization -
_idToType
Mappings from type id to JavaType, used for deserialization
-
-
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:TypeIdResolver
Accessor 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:TypeIdResolver
Method called to serialize type of the type of given value as a String to include in serialized JSON content. -
idFromValueAndType
Description copied from interface:TypeIdResolver
Alternative 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:TypeIdResolver
Method called to resolve type from given type identifier.- Throws:
IllegalArgumentException
-
toString
-
_defaultTypeId
If no name was explicitly given for a class, we will just use non-qualified class name
-