01: /* Annotation.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Wed Oct 25 16:05:13 2006, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2006 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zk.ui.metainfo;
20:
21: import java.util.Map;
22:
23: /**
24: * The common interface extended by all annotation types.
25: * An annotation consists of a name ({@link #getName}) and a map of attributes
26: * {@link #getAttribute}.
27: *
28: * <p>To get the annotation associated with a component, use
29: * {@link org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotation(String)}.
30: * To get the annotation associated with a component's property,
31: * use {@link org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotation(String, String)}
32: *
33: * @author tomyeh
34: * @see org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotation(String)
35: * @see org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotation(String, String)
36: * @see org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotations()
37: * @see org.zkoss.zk.ui.sys.ComponentCtrl#getAnnotations(String)
38: */
39: public interface Annotation extends java.io.Serializable {
40: /** Returns the name of this annotation.
41: *
42: * <p>For each declaration, there is at most one annotation with the same
43: * name.
44: */
45: public String getName();
46:
47: /** Returns the map of attributes (String name, String value) (never null).
48: * The returned map is read-only.
49: */
50: public Map getAttributes();
51:
52: /** Returns the attribute of the given name, or null if not found.
53: */
54: public String getAttribute(String name);
55: }
|