Annotating Source Code Directly
Your source code can contain various annotations. For example, @Nullable
and @NotNull
annotations are used, when IntelliJ IDEA supposes that a certain element can become Null
.
The @NonNls
annotation is used to ignore the hard-coded string literals.
To use annotations
- Make sure that
annotations.jar
that can be found in thelib
folder under the IntelliJ IDEA installation, is added to the module dependencies.For
@javax.annotation.ParametersAreNonnullByDefault
annotations,javax
should be added to the module libraries. - Introduce the desired annotation before the package/class/field/variable/method/method parameter declaration.
See Also
Last modified: 23 November 2016