Class ConstructorDetector

java.lang.Object
tools.jackson.databind.cfg.ConstructorDetector
All Implemented Interfaces:
Serializable

public final class ConstructorDetector extends Object implements Serializable
Configurable handler used to select aspects of selecting constructor(s) to use as "Creators" for POJOs. Defines the API for handlers, a pre-defined set of standard instances and methods for constructing alternative configurations.
Since:
2.12
See Also:
  • Field Details

  • Constructor Details

    • ConstructorDetector

      protected ConstructorDetector(ConstructorDetector.SingleArgConstructor singleArgMode, boolean requireCtorAnnotation, boolean allowJDKTypeCtors, boolean allowImplicitWithDefaultConstructor)
    • ConstructorDetector

      protected ConstructorDetector(ConstructorDetector.SingleArgConstructor singleArgMode)
      Constructors used for default configurations which only varies by _singleArgMode
  • Method Details

    • withSingleArgMode

      public ConstructorDetector withSingleArgMode(ConstructorDetector.SingleArgConstructor singleArgMode)
    • withRequireAnnotation

      public ConstructorDetector withRequireAnnotation(boolean state)
    • withAllowJDKTypeConstructors

      public ConstructorDetector withAllowJDKTypeConstructors(boolean state)
    • withAllowImplicitWithDefaultConstructor

      public ConstructorDetector withAllowImplicitWithDefaultConstructor(boolean state)
      Mutant factory method that can be used to change setting that allowImplicitWithDefaultConstructor() returns.
      Since:
      3.0
    • singleArgMode

    • requireCtorAnnotation

      public boolean requireCtorAnnotation()
    • allowJDKTypeConstructors

      public boolean allowJDKTypeConstructors()
    • allowImplicitWithDefaultConstructor

      public boolean allowImplicitWithDefaultConstructor()
      Method that can be used to determine whether implicit detection of Properties-based Constructors is allowed when there is a default (no-parameter) constructor available. Note that this only matters if shouldIntrospectImplicitConstructors(java.lang.Class<?>) returns true.
      Since:
      3.0
    • singleArgCreatorDefaultsToDelegating

      public boolean singleArgCreatorDefaultsToDelegating()
    • singleArgCreatorDefaultsToProperties

      public boolean singleArgCreatorDefaultsToProperties()
    • shouldIntrospectImplicitConstructors

      public boolean shouldIntrospectImplicitConstructors(Class<?> rawType)
      Accessor that combines checks for whether implicit creators are allowed and, if so, whether JDK type constructors are allowed (if type is JDK type) to determine whether implicit constructor detection should be enabled for given type or not.
      Parameters:
      rawType - Value type to consider
      Returns:
      True if implicit constructor detection should be enabled; false if not