Package com.fasterxml.jackson.annotation
Annotation Type JacksonInject
-
@Target({ANNOTATION_TYPE,METHOD,FIELD,PARAMETER}) @Retention(RUNTIME) public @interface JacksonInjectJackson-specific annotation used for indicating that value of annotated property will be "injected", i.e. set based on value configured byObjectMapper(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.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description OptBooleanoptionalWhether to throw an exception when theObjectMapperdoes not find the value to inject.OptBooleanuseInputWhether 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.java.lang.StringvalueLogical id of the value to inject; if not specified (or specified as empty String), will use id based on declared type of property.
-
-
-
-
useInput
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.Default is `OptBoolean.DEFAULT`, which translates to `OptBoolean.TRUE`.
- Returns:
OptBoolean.TRUEto enable use of value from input instead of injected value, if available;OptBoolean.FALSEif injected value will always be used regardless of input.
- Default:
- com.fasterxml.jackson.annotation.OptBoolean.DEFAULT
-
-
-
optional
OptBoolean optional
Whether to throw an exception when theObjectMapperdoes not find the value to inject.Default is
OptBoolean.DEFAULTfor backwards-compatibility: in this caseObjectMapperdefaults are used (which in turn are same as {code OptBoolean.FALSE}).- Returns:
OptBoolean.FALSEto throw an exception;OptBoolean.TRUEto avoid throwing it; orOptBoolean.DEFAULTto use configure defaults (which are same asOptBoolean.FALSEfor Jackson 2.x)
- Default:
- com.fasterxml.jackson.annotation.OptBoolean.DEFAULT
-
-