public static enum ConstructorDetector.SingleArgConstructor extends Enum<ConstructorDetector.SingleArgConstructor>
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).
Default choice is HEURISTIC
(which is Jackson pre-2.12 always uses)
NOTE: does NOT have any effect if explicit @JsonCreator
} annotation
is required.
Enum Constant and Description |
---|
DELEGATING
Assume "delegating" mode if not explicitly annotated otherwise
|
HEURISTIC
Use heuristics to see if "properties" mode is to be used (POJO has a
property with the same name as the implicit name [if available] of
the constructor argument).
|
PROPERTIES
Assume "properties" mode if not explicitly annotated otherwise
|
REQUIRE_MODE
Refuse to decide implicit mode and instead throw a
InvalidDefinitionException
in ambiguous case. |
Modifier and Type | Method and Description |
---|---|
static ConstructorDetector.SingleArgConstructor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConstructorDetector.SingleArgConstructor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConstructorDetector.SingleArgConstructor DELEGATING
public static final ConstructorDetector.SingleArgConstructor PROPERTIES
public static final ConstructorDetector.SingleArgConstructor HEURISTIC
public static final ConstructorDetector.SingleArgConstructor REQUIRE_MODE
InvalidDefinitionException
in ambiguous case.public static ConstructorDetector.SingleArgConstructor[] values()
for (ConstructorDetector.SingleArgConstructor c : ConstructorDetector.SingleArgConstructor.values()) System.out.println(c);
public static ConstructorDetector.SingleArgConstructor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2008–2021 FasterXML. All rights reserved.