Class SubtypeResolver

java.lang.Object
tools.jackson.databind.jsontype.SubtypeResolver
All Implemented Interfaces:
Snapshottable<SubtypeResolver>
Direct Known Subclasses:
StdSubtypeResolver

public abstract class SubtypeResolver extends Object implements Snapshottable<SubtypeResolver>
Helper object used for handling registration on resolving of super-types to sub-types.
  • Constructor Details

    • SubtypeResolver

      public SubtypeResolver()
  • Method Details

    • snapshot

      public abstract SubtypeResolver snapshot()
      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 Snapshottable<SubtypeResolver>
      Since:
      3.0
    • registerSubtypes

      public abstract SubtypeResolver registerSubtypes(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).
    • registerSubtypes

      public abstract SubtypeResolver registerSubtypes(Class<?>... classes)
    • registerSubtypes

      public abstract SubtypeResolver registerSubtypes(Collection<Class<?>> subtypes)
    • collectAndResolveSubtypesByClass

      public abstract 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).
      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 abstract Collection<NamedType> collectAndResolveSubtypesByClass(MapperConfig<?> config, AnnotatedClass baseType)
      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).
      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 abstract 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).
      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 abstract 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).
      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.