@Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(value=GuardedByUnknown.class) @DefaultQualifierInHierarchy @DefaultFor(value={EXCEPTION_PARAMETER,UPPER_BOUND}, typeKinds={BOOLEAN,BYTE,CHAR,DOUBLE,FLOAT,INT,LONG,SHORT}, types={java.lang.String.class,java.lang.Void.class}) @UpperBoundFor(typeKinds={BOOLEAN,BYTE,CHAR,DOUBLE,FLOAT,INT,LONG,SHORT}, types=java.lang.String.class) public @interface GuardedBy
@GuardedBy({})
is the default type qualifier.
The argument is a string or set of strings that indicates the expression(s) that must be held,
using the syntax of
Java expressions described in the manual. The expressions evaluate to an intrinsic (built-in,
synchronization) monitor or an explicit Lock
. The expression
"<self>"
is also permitted; the type @GuardedBy("<self>") Object o
indicates that
the value referenced by o
is guarded by the intrinsic (monitor) lock of the value
referenced by o
.
Two @GuardedBy
annotations with different argument expressions are unrelated by
subtyping.
Holding
@JavaExpression public abstract String[] value