@Target(value={ANNOTATION_TYPE,METHOD,FIELD,PARAMETER}) @Retention(value=RUNTIME) public @interface JacksonInject
ObjectMapper (usually on per-call basis).
Usually property is not deserialized from JSON, although it is possible
to have injected value as default and still allow optional override
from JSON.| Modifier and Type | Optional Element and Description |
|---|---|
OptBoolean |
optional
Whether to throw an exception when the
ObjectMapper does not find
the value to inject. |
OptBoolean |
useInput
Whether matching value from input (if any) is used for annotated property or not;
if disabled (
OptBoolean.FALSE), input value (if any) will be ignored;
otherwise it will override injected value. |
String |
value
Logical id of the value to inject; if not specified (or specified
as empty String), will use id based on declared type of property.
|
public abstract String value
public abstract OptBoolean useInput
OptBoolean.FALSE), input value (if any) will be ignored;
otherwise it will override injected value.
Default is OptBoolean.DEFAULT, which translates to OptBoolean.TRUE.
OptBoolean.TRUE to enable use of value from input instead of
injected value, if available; OptBoolean.FALSE if injected value will
always be used regardless of input.public abstract OptBoolean optional
ObjectMapper does not find
the value to inject.
Default is OptBoolean.DEFAULT for backwards-compatibility: in this
case ObjectMapper defaults are used (which in turn are same
as {code OptBoolean.FALSE}).
OptBoolean.FALSE to throw an exception; OptBoolean.TRUE
to avoid throwing it; or OptBoolean.DEFAULT to use configure defaults
(which are same as OptBoolean.FALSE for Jackson 2.x)Copyright © 2008–2025 FasterXML. All rights reserved.