|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Retention(value=RUNTIME) public @interface NonNullOnEntry
Indicates a method precondition: the method expects the specified variables (typically field references) to be non-null when the annotated method is invoked.
For example:
@Nullable Object field1; @Nullable Object field2; @NonNullOnEntry("field1") void method1() { field1.toString(); // OK, field1 is known to be non-null field2.toString(); // error, might throw NullPointerException } void method2() { field1 = new Object(); method1(); // OK, satisfies method precondition field1 = null; method1(); // error, does not satisfy method precondition }
Modifier and Type | Required Element and Description |
---|---|
String[] |
value
Java expression(s) that are non-null when the method is entered -- that is, when it is invoked. |
Element Detail |
---|
public abstract String[] value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |