@Documented @Target(value={TYPE_USE,TYPE_PARAMETER}) @Retention(value=RUNTIME) @TypeQualifier @SubtypeOf(value={}) public @interface GuardedBy
Lock
.
This annotation does not indicate whether or not the given lock
is held. It merely indicates that the lock must be held when the
reference is accessed. An unannotated reference is a subtype of a
@GuardedBy
one, because the unannotated reference may be
used in any context where the @GuardedBy
reference is.
The argument is a string that indicates which lock guards the annotated variable:
this
: The intrinsic lock of the object in whose class the field is defined.
class-name.this
: For inner classes, it may be necessary to disambiguate 'this';
the class-name.this designation allows you to specify which 'this' reference is intended
itself
: For reference fields only; the object to which the field refers.
field-name
: The lock object is referenced by the (instance or static) field
specified by field-name.
class-name.field-name
: The lock object is reference by the static field specified
by class-name.field-name.
method-name()
: The lock object is returned by calling the named nil-ary method.
class-name.class
: The Class object for the specified class should be used as the lock object.
Holding
public abstract String value