Creating and configuring Java EE modules using annotations
Annotations are a modifier or metadata tag that provide additional data to Java™ classes, interfaces, constructors, methods, fields,
parameters, and local variables. With Java EE, you can use
annotations to create and configure modules.
Java EE with annotations overview
The goal of Java EE 6 platform development is to minimize the number of artifacts that you have to create and maintain, thereby simplifying the development process. Java EE supports the injection of annotations into your source code, so that you can embed resources, dependencies, services, and lifecycle notifications in your source code, without having to maintain these artifacts elsewhere.
Scope and placement of annotations
You can add annotations to your source code at the class, method, and field level.
Annotations view
The Annotations view detects the annotation types from the metadata of the annotation tag implementation class, shows you any default values, and provides a place to add, edit, and remove annotations.
Defining your own annotations
You can use the @interface
annotation to create your own annotation definition.
Adding annotations
You can add annotations into your source code by using the Annotations view or by adding the annotation directly in the Java editor.
Editing annotations
You can edit annotations in your source code by directly modifying the annotation in the Java editor or by using the Annotations view.
Removing annotations
You can remove annotations in your source code by directly deleting the annotation in the Java editor or by using the Annotations view.
Viewing overridden annotations
The Annotations view detects if the value of an annotation or a parameter has been overridden by a deployment descriptor value.
Excluding files from annotation scanning
Using the annotation exclusion tool, you can indicate files that you want to exclude from annotation scanning.
Types of annotations
Java EE defines a number of types or groups of annotations, which are defined in a number of Java Specification Requests (JSRs).