Annotation-based Programming Tags

Annotation-based programming defines a collection of Javadoc-syntax tags that you insert into your source code.

Annotation Tag Elements

  1. Types of Tags

    Annotation-based programming tags are classified in three groups:

    • Technology Tags

      Technology tags map directly to key technologies in J2EE and other standards. Many of these tags are derived directly from the XDoclet community. See For more information, see XDoclet for more details

    • Bindings and Extension Tags

      These tags allow you to specify WebSphere-specific bindings and extensions data that are not part of standard technology.

    • Behavioral Tags

      Behavioral tags annotate a desired behavior or quality of service and not specific implementation technologies. The program determines the appropriate implementation technology later in the process.

  2. Scope

    Scope refers to the location of the tags within the Java™ source file. Four valid scope options are package, class, method, and field.

    • Package

      You can add tags to the package comment. This scope provides information applicable to the entire Java package, to the module, or to the application as a whole.

    • Class

      You can add tags to the class comment. This scope provides information about the Java type or interface as a whole.

    • Method

      You can add tags to the comments of a particular method within the class. This scope provides information about the referenced method within the class.

    • Field

      You can add tags to the comments of a particular field within the class. This scope provides information specific to the referenced field within the class.

  3. Multiplicity

    Multiplicity refers to the number of times a particular tag can appear in one Java source file. In XDoclet notation, multiplicity is indicated in parenthesis following the tag name

    Example

    @ejb.bean (0..1) indicates that the "@ejb.bean" tag can be used zero or one time in a Java source file.

    @ejb.ejb-external-ref (0..*) indicates that the "@ejb.ejb-external-ref" tag can be used zero to an infinite number of times in a Java source file.


Feedback