@Documented @Retention(value=CLASS) @Target(value=ANNOTATION_TYPE) public @interface IncompatibleModifiers
@IncompatibleModifiers(modifier = Modifier.PUBLIC) @interface MyAnnotation {}
will be considered illegal when used as:
@MyAnnotation public void foo() {}
Modifier and Type | Optional Element and Description |
---|---|
Modifier[] |
modifier
The incompatible modifiers.
|
Modifier[] |
value
Deprecated.
use
modifier() instead |
@Deprecated public abstract Modifier[] value
modifier()
insteadpublic abstract Modifier[] modifier
Empty array has the same effect as not applying this annotation at all; duplicates are allowed but have no effect.
Copyright © 2021 Google LLC. All rights reserved.