Using Annotations

Annotations are a way to extend the Tigerstripe model in a controlled manner. When an annotation (sometimes referred to as a Stereotype) is applied to a model element such as a method, the user can specify values for each attribute of that annotation. This information can then be used in a plugin to add information to the output, or to influence the behaviour of the model.

Annotations must be defined in the current profile for the workbench session prior to their use. See Creating and Using Profiles for more information.

Applying Annotations

Annotations are applied to model elements in the artifact editor. Annotations at the Artifact level can be applied in the General Information section of the Overview pane, annotations at the arrubute, label and method level can be applied in the Attributes, Labels and Methods sections respectively, by highlighting the compoent to which the annotation is to be applied.

Within the relevant section, locate the "Annotations" Editor, which may initially be collapsed. It can be expanded by clicking on the "Annotations" title. Clicking on the "Add" button will show a list of annotations that are applicable for the model element. Remember that there may be no annotations specified with a scope equal to the model component you are looking at. Selecting an item form the list and clicking "OK" will apply the stereotype to the model element.

Setting Annotation Attribute Values

Once an annotation is applied, you can set the value of the annotation attributes (if it has any). Select the annotation in the Annotations editor and either double click it, or press the "Edit" button. This will pop up an "Annotations Details" dialog, which will show the list of attributes that have been defined. Depending on the type of the attribute, you can enter the String value, Check the box or Select a value from a list, or edit the array values. In the case of an array attribute, use the "Add" and "Remove" buttons to modify the array contents, and double click on an individiual entry to edit the String value on the array entry.


© copyright 2005, 2006, 2007 Cisco Systems, Inc. - All rights reserved