Annotating Source Code Directly
Your source code can contain various annotations. For example,
@NotNull annotations are used, when IntelliJ IDEA supposes that a certain element can become
@NonNls annotation is used to ignore the hardcoded string literals.
To use annotations
- Make sure that
annotations.jarthat can be found in the
libfolder under the IntelliJ IDEA installation, is added to the module dependencies.
javaxshould be added to the module libraries.
- Introduce the desired annotation before the package/class/field/variable/method/method parameter declaration.