@Target(value=TYPE) @Retention(value=RUNTIME) public @interface JsonAutoDetect
Pseudo-value NONE
means that all auto-detection is disabled
for the specific class that annotation is applied to (including
its super-types, but only when resolving that class).
Pseudo-value ALWAYS
means that auto-detection is enabled
for all method types for the class in similar way.
The default value is ALWAYS
: that is, by default, auto-detection
is enabled for all classes unless instructed otherwise.
Starting with version 1.5, it is also possible to use more fine-grained definitions, to basically define minimum visibility level needed. Defaults are different for different types (getters need to be public; setters can have any access modifier, for example).
限定符和类型 | 可选元素和说明 |
---|---|
JsonAutoDetect.Visibility |
creatorVisibility
Minimum visibility required for auto-detecting Creator methods,
except for no-argument constructors (which are always detected
no matter what).
|
JsonAutoDetect.Visibility |
fieldVisibility
Minimum visibility required for auto-detecting member fields.
|
JsonAutoDetect.Visibility |
getterVisibility
Minimum visibility required for auto-detecting regular getter methods.
|
JsonAutoDetect.Visibility |
isGetterVisibility
Minimum visibility required for auto-detecting is-getter methods.
|
JsonAutoDetect.Visibility |
setterVisibility
Minimum visibility required for auto-detecting setter methods.
|
JsonMethod[] |
value
Types of property elements (getters, setters, fields, creators) that
can be auto-detected.
|
public abstract JsonMethod[] value
public abstract JsonAutoDetect.Visibility getterVisibility
public abstract JsonAutoDetect.Visibility isGetterVisibility
public abstract JsonAutoDetect.Visibility setterVisibility
public abstract JsonAutoDetect.Visibility creatorVisibility
public abstract JsonAutoDetect.Visibility fieldVisibility