Classic method of annotating

From Documentation
Documentationlassic method of annotating
lassic method of annotating

The Classic Way to annotate the Component Declarations

The annotation appears before the declaration of the element that you want to annotate:

<window xmlns:a="[]">
        <a:author name="John Magic" date="3/17/2006"/>

The annotation is an element in the namespace. The element name and attributes can be anything depending on the tool you use. You can annotate the same component declaration with several annotations:

<a:author name="John Magic"/>
<a:editor name="Mary White" date="4/11/2006"/>

where author and editor are the annotation names, while name and date are the attribute names. In other words, an annotation consists of a name and a map of attributes.

If the annotations annotating a declaration have the same name, they are merged as a single annotation. For example,

<a:define var1="auto"/>
<a:define var2="123"/>

is equivalent to

<a:define var1="auto" var2="123"/>

Note: Annotations don't support EL expressions.

The Classic Way to Annotate the Property Declarations

To annotation a property declaration, you can put the annotation in front of the declaration of a property as shown below.

<listitem a:bind="datasource='author',name='name'" value="${}"/>

Alternatively, you can use the attribute element and annotate the declaration of a property similar to the component declaration. In other words, the above annotation is equivalent to the following:

    <a:bind datasource="author" name="name"/>
    <attribute name="value">${}</attribute>

Note: if the attribute name of a annotation is omitted, the name is assumed to be value. For example,

<listitem a:bind="value='selected'" value=""/>

is equivalent to

<listitem a:bind="selected" value=""/>

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.