public final class ConstructorDetector
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ConstructorDetector.SingleArgConstructor
Definition of alternate handling modes of single-argument constructors
that are annotated with
JsonCreator
but without "mode" definition (or explicit name for the argument):
this is the case where two interpretations
are possible -- "properties" (in which case the argument is named parameter
of a JSON Object) and "delegating (in which case the argument maps to the
whole JSON value). |
Modifier and Type | Field and Description |
---|---|
static ConstructorDetector |
DEFAULT
Instance used by default, which:
Uses
ConstructorDetector.SingleArgConstructor.HEURISTIC for single-argument constructor case
Does not require explicit @JsonCreator annotations (so allows
auto-detection of Visible constructors} (except for JDK types)
Does not allow auto-detection of Visible constructors for so-called JDK
types; that is, classes in packages java.* and javax.*
|
static ConstructorDetector |
EXPLICIT_ONLY
Instance similar to
DEFAULT except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.REQUIRE_MODE . |
static ConstructorDetector |
USE_DELEGATING
Instance similar to
DEFAULT except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.DELEGATING . |
static ConstructorDetector |
USE_PROPERTIES_BASED
Instance similar to
DEFAULT except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.PROPERTIES . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowJDKTypeConstructors() |
boolean |
requireCtorAnnotation() |
boolean |
shouldIntrospectorImplicitConstructors(java.lang.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.
|
boolean |
singleArgCreatorDefaultsToDelegating() |
boolean |
singleArgCreatorDefaultsToProperties() |
ConstructorDetector.SingleArgConstructor |
singleArgMode() |
ConstructorDetector |
withAllowJDKTypeConstructors(boolean state) |
ConstructorDetector |
withRequireAnnotation(boolean state) |
ConstructorDetector |
withSingleArgMode(ConstructorDetector.SingleArgConstructor singleArgMode) |
public static final ConstructorDetector DEFAULT
ConstructorDetector.SingleArgConstructor.HEURISTIC
for single-argument constructor case
@JsonCreator
annotations (so allows
auto-detection of Visible constructors} (except for JDK types)
java.*
and javax.*
public static final ConstructorDetector USE_PROPERTIES_BASED
DEFAULT
except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.PROPERTIES
.public static final ConstructorDetector USE_DELEGATING
DEFAULT
except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.DELEGATING
.public static final ConstructorDetector EXPLICIT_ONLY
DEFAULT
except that for single-argument case
uses setting of ConstructorDetector.SingleArgConstructor.REQUIRE_MODE
.public ConstructorDetector withSingleArgMode(ConstructorDetector.SingleArgConstructor singleArgMode)
public ConstructorDetector withRequireAnnotation(boolean state)
public ConstructorDetector withAllowJDKTypeConstructors(boolean state)
public ConstructorDetector.SingleArgConstructor singleArgMode()
public boolean requireCtorAnnotation()
public boolean allowJDKTypeConstructors()
public boolean singleArgCreatorDefaultsToDelegating()
public boolean singleArgCreatorDefaultsToProperties()
public boolean shouldIntrospectorImplicitConstructors(java.lang.Class<?> rawType)
rawType
- Value type to considerCopyright © 2010 - 2023 Adobe. All Rights Reserved