Class AnnotationMap

java.lang.Object
org.zkoss.zk.ui.metainfo.AnnotationMap
All Implemented Interfaces:
Serializable, Cloneable

public class AnnotationMap extends Object implements Cloneable, Serializable
A map of annotations used with ComponentDefinition and ComponentInfo.

Note: it is not thread safe.

Author:
tomyeh
See Also:
  • Constructor Details

    • AnnotationMap

      public AnnotationMap()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns whether no annotation at all.
    • getAnnotation

      public Annotation getAnnotation(String propName, String annotName)
      Returns the annotation associated with the specified property, or null if not available.
      Parameters:
      annotName - the annotation name
      propName - the property name, e.g., "value". If null, this method returns the annotation(s) associated with the component (rather than a particular property).
    • getAnnotations

      public Collection<Annotation> getAnnotations(String propName, String annotName)
      Returns the annotations associated with the specified property. It never returns null.
      Parameters:
      annotName - the annotation name
      propName - the property name, e.g., "value". If null, this method returns the annotation(s) associated with the component (rather than a particular property).
      Since:
      6.0.0
    • getAnnotations

      public Collection<Annotation> getAnnotations(String propName)
      Returns a read-only collection of all annotations associated with the the specified property.
      Parameters:
      propName - the property name, e.g., "value". If null, this method returns the annotation(s) associated with the component (rather than a particular property).
    • getAnnotatedPropertiesBy

      public List<String> getAnnotatedPropertiesBy(String annotName)
      Returns a read-only list of the names (String) of the properties that are associated with the specified annotation (never null).
    • getAnnotatedProperties

      public List<String> getAnnotatedProperties()
      Returns a read-only list of the name (String) of properties that are associated at least one annotation (never null).
    • addAll

      public void addAll(AnnotationMap src)
      Adds all annotations of the specified map to this map.
    • addAnnotation

      public void addAnnotation(String propName, String annotName, Map<String,String[]> annotAttrs, org.zkoss.util.resource.Location loc)
      Adds an annotation.
      Parameters:
      propName - the property name. If null, this method returns the annotation(s) associated with the component (rather than a particular property).
      Since:
      6.0.0
    • clone

      public Object clone()
      Clones this annotation map.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object