Package checkers.quals
Annotation Interface Dependent
Refines the qualified type of the annotated field or variable based on the
qualified type of the receiver. The annotation declares a relationship
between multiple type qualifier hierarchies.
Example:
Consider a field, lock
, that is only initialized if the
enclosing object (the receiver), is marked as ThreadSafe
.
Such a field can be declared as:
private @Nullable @Dependent(result=NonNull.class, when=ThreadSafe.class)
Lock lock;
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionClass<? extends Annotation>
Class<? extends Annotation>
-
Element Details
-
result
Class<? extends Annotation> result- Returns:
- the class of the refined qualifier to be applied.
-
when
Class<? extends Annotation> when- Returns:
- the qualifier class of the receiver that causes the
result
qualifier to be applied.
-