@Documented @Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) @InheritedAnnotation @Repeatable(value=EnsuresQualifiers.class) public @interface EnsuresQualifier
expression
and are
specified using a string. The qualifier is specified by qualifier
.
Here is an example use:
@EnsuresQualifier(expression = "p.f1", qualifier = Odd.class)
void oddF1_1() {
p.f1 = null;
}
Some type systems have specialized versions of this annotation, such as org.checkerframework.checker.nullness.qual.EnsuresNonNull
and org.checkerframework.checker.lock.qual.EnsuresLockHeld
.EnsuresQualifierIf
Modifier and Type | Required Element and Description |
---|---|
String[] |
expression
The Java expressions for which the qualifier holds after successful method termination.
|
Class<? extends Annotation> |
qualifier
The qualifier that is guaranteed to hold on successfull termination of the method.
|
public abstract String[] expression
public abstract Class<? extends Annotation> qualifier