Package edu.umd.cs.findbugs.annotations
Annotation Type DefaultAnnotation
@Documented
@Target({TYPE,PACKAGE})
@Retention(CLASS)
@Deprecated
public @interface DefaultAnnotation
Deprecated.
Indicates that all members of the class or package should be annotated with
the default value of the supplied annotation class.
This would be used for behavior annotations such as @NonNull, @CheckForNull,
or @CheckReturnValue.
In particular, you can use @DefaultAnnotation(NonNull.class) on a class or
package, and then use @Nullable only on those parameters, methods or fields
that you want to allow to be null.
- Author:
- William Pugh
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDeprecated.Deprecated.
-
Element Details
-
value
Class<? extends Annotation>[] valueDeprecated.
-
-
-
priority
Deprecated.- Default:
- MEDIUM
-
confidence
Confidence confidenceDeprecated.- Default:
- MEDIUM
-
ParametersAreNonnullByDefault
instead of @DefaultAnnotation(NonNull.class) so that method parameters are nonnull by default in the annotated element. You can also useTypeQualifierDefault
in general to define your own annotation that specifies a default type qualifier. For example,The JSR305
CheckReturnValue
annotation can be applied to a type or package, and it will act as a default for all methods in that class or package unless otherwise overridden.