Class StdSubtypeResolver
- java.lang.Object
-
- com.fasterxml.jackson.databind.jsontype.SubtypeResolver
-
- com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver
-
- All Implemented Interfaces:
Serializable
public class StdSubtypeResolver extends SubtypeResolver implements Serializable
StandardSubtypeResolverimplementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StdSubtypeResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<NamedType>collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedClass type)Method for finding out all reachable subtypes for given type, such that access is by type, typically needed for serialization (converting from type to type name).Collection<NamedType>collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedMember property, JavaType baseType)Method for finding out all reachable subtypes for a property specified by given element (method or field), such that access is by type, typically needed for serialization (converting from type to type name).Collection<NamedType>collectAndResolveSubtypesByTypeId(MapperConfig<?> config, AnnotatedClass baseType)Method for finding out all reachable subtypes for given type, such that access is by type id, typically needed for deserialization (converting from type id to type).Collection<NamedType>collectAndResolveSubtypesByTypeId(MapperConfig<?> config, AnnotatedMember property, JavaType baseType)Method for finding out all reachable subtypes for a property specified by given element (method or field), such that access is by type id, typically needed for deserialization (converting from type id to type).SubtypeResolvercopy()Method called byObjectMapper.copy()to make sure thatSubtypeResolverinstances used by two independent mappers can not cause thread-safety issues: if resolver is immutable, it may returnthis, but if not, it should create a copy with same configuration and return that instead.voidregisterSubtypes(NamedType... types)Method for registering specified subtypes (possibly including type names); for type entries without name, non-qualified class name as used as name (unless overridden by annotation).voidregisterSubtypes(Class<?>... classes)voidregisterSubtypes(Collection<Class<?>> subtypes)-
Methods inherited from class com.fasterxml.jackson.databind.jsontype.SubtypeResolver
collectAndResolveSubtypes, collectAndResolveSubtypes
-
-
-
-
Method Detail
-
copy
public SubtypeResolver copy()
Description copied from class:SubtypeResolverMethod called byObjectMapper.copy()to make sure thatSubtypeResolverinstances used by two independent mappers can not cause thread-safety issues: if resolver is immutable, it may returnthis, but if not, it should create a copy with same configuration and return that instead.- Overrides:
copyin classSubtypeResolver- Returns:
- Either new instance with same configuration as this one (if instances are mutable), or this instance (if immutable)
-
registerSubtypes
public void registerSubtypes(NamedType... types)
Description copied from class:SubtypeResolverMethod for registering specified subtypes (possibly including type names); for type entries without name, non-qualified class name as used as name (unless overridden by annotation).- Specified by:
registerSubtypesin classSubtypeResolver
-
registerSubtypes
public void registerSubtypes(Class<?>... classes)
- Specified by:
registerSubtypesin classSubtypeResolver
-
registerSubtypes
public void registerSubtypes(Collection<Class<?>> subtypes)
- Specified by:
registerSubtypesin classSubtypeResolver
-
collectAndResolveSubtypesByClass
public Collection<NamedType> collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedMember property, JavaType baseType)
Description copied from class:SubtypeResolverMethod for finding out all reachable subtypes for a property specified by given element (method or field), such that access is by type, typically needed for serialization (converting from type to type name).- Overrides:
collectAndResolveSubtypesByClassin classSubtypeResolverbaseType- Effective property base type to use; may differ from actual type of property; for structured types it is content (value) type and NOT structured type.
-
collectAndResolveSubtypesByClass
public Collection<NamedType> collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedClass type)
Description copied from class:SubtypeResolverMethod for finding out all reachable subtypes for given type, such that access is by type, typically needed for serialization (converting from type to type name).- Overrides:
collectAndResolveSubtypesByClassin classSubtypeResolvertype- Effective property base type to use; may differ from actual type of property; for structured types it is content (value) type and NOT structured type.
-
collectAndResolveSubtypesByTypeId
public Collection<NamedType> collectAndResolveSubtypesByTypeId(MapperConfig<?> config, AnnotatedMember property, JavaType baseType)
Description copied from class:SubtypeResolverMethod for finding out all reachable subtypes for a property specified by given element (method or field), such that access is by type id, typically needed for deserialization (converting from type id to type).- Overrides:
collectAndResolveSubtypesByTypeIdin classSubtypeResolverbaseType- Effective property base type to use; may differ from actual type of property; for structured types it is content (value) type and NOT structured type.
-
collectAndResolveSubtypesByTypeId
public Collection<NamedType> collectAndResolveSubtypesByTypeId(MapperConfig<?> config, AnnotatedClass baseType)
Description copied from class:SubtypeResolverMethod for finding out all reachable subtypes for given type, such that access is by type id, typically needed for deserialization (converting from type id to type).- Overrides:
collectAndResolveSubtypesByTypeIdin classSubtypeResolverbaseType- Effective property base type to use; may differ from actual type of property; for structured types it is content (value) type and NOT structured type.
-
-