Retrieve Annotations

From Documentation
Revision as of 08:29, 16 July 2010 by Maya001122 (talk | contribs) (Created page with '{{ZKDevelopersGuidePageHeader}} The annotations can be retrieved back at the run-time. They are usually retrieved by tools, such as the data-binding manager, rather than applica…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Retrieve Annotations


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


The annotations can be retrieved back at the run-time. They are usually retrieved by tools, such as the data-binding manager, rather than applications. In other words, applications annotate a ZUML page to tell the tools how to handle components for a particular purpose.

The following is an example to dump all annotations of a component:

 void dump(StringBuffer sb, Component comp) {
    ComponentCtrl compCtrl = (ComponentCtrl)comp;
     sb.append(comp.getId()).append(": ")
       .append(compCtrl .getAnnotations()).append('\n');

     for (Iterator it = compCtrl.getAnnotatedProperties().iterator(); it.hasNext();) {
         String prop = it.next();
         sb.append(" with ").append(prop).append(": ")
             .append(compCtrl .getAnnotations(prop)).append('\n');
     }
 }



Last Update : 2010/07/16

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