org.codehaus.jackson.annotate
Annotation Type JsonIgnore


@Target(value={METHOD,CONSTRUCTOR})
@Retention(value=RUNTIME)
public @interface JsonIgnore

Marker annotation similar to javax.xml.bind.annotation.XmlTransient that indicates that the annotated method is to be ignored by introspection-based serialization and deserialization functionality. That is, it should not be consider a "getter", "setter" or "creator".

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 basis; annotation on one method does not imply ignoring other methods. 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.


Optional Element Summary
 boolean value
          Optional argument that defines whether this annotation is active or not.
 

value

public abstract boolean value
Optional argument that defines whether this annotation is active or not. The only use for value 'false' if for overriding purposes (which is not needed often); most likely it is needed for use with "mix-in annotations" (aka "annotation overrides"). For most cases, however, default value of "true" is just fine and should be omitted.

Default:
true