Java 5 annotations

IBM® Engineering Systems Design Rhapsody® for Java™ developers supports the concept of the Java 5 annotation through modeling and code generation. Java users can use Java annotations to model and generate code for all key Java 5 concepts. You can create annotations within the Rhapsody environment and then generate the annotations within the generated code.

Note the following possible uses for Java annotations:

  • They provide data about the program but do not affect the program itself.
  • They can be used by:
    • compilers
    • documentation tools
    • code analysis tools
    • deployment tools
    • run-time analysis tools
  • They can be applied on any program element (for example, class, field, method, enum, and so on).

To add a JavaAnnotation to a model element, you must do the following general steps:

  1. Create a JavaAnnotation type; see Creating a JavaAnnotation type.
  2. Add the JavaAnnotation and assign values to the elements of the annotation; see Using a JavaAnnotation type.
  3. Add the annotation to one or more Java model elements using a dependency with a AnnotationUsage relationship; see Using a JavaAnnotation within a model.