@Target(value={METHOD,CONSTRUCTOR,FIELD})
@Retention(value=RUNTIME)
public @interface JsonIgnore
For example, a "getter" method that would otherwise denote a property (like, say, "getValue" to suggest property "value") to serialize, would be ignored and no such property would be output unless another annotation defines alternative method to use.
This annotation works purely on method-by-method (or field-by-field) basis; annotation on one method or field does not imply ignoring other methods or fields. Specifically, marking a "setter" candidate does not change handling of matching "getter" method (or vice versa).
Annotation is usually used just a like a marker annotation, that
is, without explicitly defining 'value' argument (which defaults
to true
): but argument can be explicitly defined.
This can be done to override an existing JsonIgnore by explictly
defining one with 'false' argument.
Annotation is similar to XmlTransient
Modifier and Type | Optional Element and Description |
---|---|
boolean |
value
Optional argument that defines whether this annotation is active
or not.
|
public abstract boolean value