Package org.zkoss.zk.ui.metainfo

## Interface Annotation

- All Superinterfaces:
    `java.io.Serializable`

      public interface Annotation
      extends java.io.Serializable

  The common interface extended by all annotation types. An annotation consists of a name (`getName()`) and a map of attributes `getAttribute(java.lang.String)`.

  To get the annotation associated with a component, use `ComponentCtrl.getAnnotations(String)`. To get the annotation associated with a component's property, use `ComponentCtrl.getAnnotation(String, String)`

  Author:
    tomyeh
  See Also:
    `ComponentCtrl.getAnnotation(String, String)`, `ComponentCtrl.getAnnotations(String)`, `ComponentCtrl.getAnnotations(String, String)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getAttribute​(java.lang.String name)` | Returns the first value of the given attribute, or null if not found.
    `java.util.Map<java.lang.String,​java.lang.String[]>` | `getAttributes()` | Returns the map of attributes(never null).
    `java.lang.String[]` | `getAttributeValues​(java.lang.String name)` | Returns all values of the given attribute, or null if not found.
    `Location` | `getLocation()` | Returns the location information of the annotation in the document, or null if not available.
    `java.lang.String` | `getName()` | Returns the name of this annotation.

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Returns the name of this annotation.

      For each declaration, there is at most one annotation with the same name.

    - #### getAttributes

          java.util.Map<java.lang.String,​java.lang.String[]> getAttributes()

      Returns the map of attributes(never null). The key is a String instance, while the value is an array of String instances (length might be zero, but it is never null).

      The returned map is read-only.

    - #### getAttribute

          java.lang.String getAttribute​(java.lang.String name)

      Returns the first value of the given attribute, or null if not found. By the first value we mean the first element in the value array.

    - #### getAttributeValues

          java.lang.String[] getAttributeValues​(java.lang.String name)

      Returns all values of the given attribute, or null if not found. Notice if the attribute is assigned with no value, a zero-length array is returned.
      Since:
        6.0.0

    - #### getLocation

          Location getLocation()

      Returns the location information of the annotation in the document, or null if not available. It is useful for displaying the error message:

          private static String message(String message, Location loc) {
             return loc != null ? loc.format(message): message;
          }

      Since:
        6.0.0