Class StdSubtypeResolver

java.lang.Object
tools.jackson.databind.jsontype.SubtypeResolver
tools.jackson.databind.jsontype.impl.StdSubtypeResolver
All Implemented Interfaces:
Serializable, tools.jackson.core.util.Snapshottable<SubtypeResolver>

public class StdSubtypeResolver extends SubtypeResolver implements Serializable
Standard SubtypeResolver implementation.
See Also:
  • Field Details

  • Constructor Details

    • StdSubtypeResolver

      public StdSubtypeResolver()
    • StdSubtypeResolver

      protected StdSubtypeResolver(Set<NamedType> reg)
  • Method Details

    • snapshot

      public SubtypeResolver snapshot()
      Description copied from class: SubtypeResolver
      Method that has to create a new instance that contains same registration information as this instance, but is not linked to this instance.
      Specified by:
      snapshot in interface tools.jackson.core.util.Snapshottable<SubtypeResolver>
      Specified by:
      snapshot in class SubtypeResolver
    • registerSubtypes

      public StdSubtypeResolver registerSubtypes(NamedType... types)
      Description copied from class: SubtypeResolver
      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).
      Specified by:
      registerSubtypes in class SubtypeResolver
    • registerSubtypes

      public StdSubtypeResolver registerSubtypes(Class<?>... classes)
      Specified by:
      registerSubtypes in class SubtypeResolver
    • registerSubtypes

      public StdSubtypeResolver registerSubtypes(Collection<Class<?>> subtypes)
      Specified by:
      registerSubtypes in class SubtypeResolver
    • collectAndResolveSubtypesByClass

      public Collection<NamedType> collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedMember property, JavaType baseType)
      Description copied from class: SubtypeResolver
      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).
      Specified by:
      collectAndResolveSubtypesByClass in class SubtypeResolver
      Parameters:
      baseType - 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: SubtypeResolver
      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).
      Specified by:
      collectAndResolveSubtypesByClass in class SubtypeResolver
      Parameters:
      type - 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: SubtypeResolver
      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).
      Specified by:
      collectAndResolveSubtypesByTypeId in class SubtypeResolver
      Parameters:
      baseType - 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: SubtypeResolver
      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).
      Specified by:
      collectAndResolveSubtypesByTypeId in class SubtypeResolver
      Parameters:
      baseType - 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.
    • _collectAndResolve

      protected void _collectAndResolve(MapperConfig<?> config, AnnotatedClass annotatedType, NamedType namedType, AnnotationIntrospector ai, HashMap<NamedType, NamedType> collectedSubtypes)
      Method called to find subtypes for a specific type (class), using type (class) as the unique key (in case of conflicts).
    • _collectAndResolveByTypeId

      protected void _collectAndResolveByTypeId(MapperConfig<?> config, AnnotatedClass annotatedType, NamedType namedType, Set<Class<?>> typesHandled, Map<String, NamedType> byName)
      Method called to find subtypes for a specific type (class), using type id as the unique key (in case of conflicts).
    • _combineNamedAndUnnamed

      protected Collection<NamedType> _combineNamedAndUnnamed(Class<?> rawBase, Set<Class<?>> typesHandled, Map<String, NamedType> byName)
      Helper method used for merging explicitly named types and handled classes without explicit names.