org.zkoss.zk.ui.metainfo
Class AnnotationMap

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

public class AnnotationMap
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A map of annotations used with ComponentDefinition and ComponentInfo.

Note: it is not thread safe.

Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
AnnotationMap()
           
 
Method Summary
 void addAll(AnnotationMap src)
          Adds all annotations of the specified map to this map.
static void addAllAns(java.util.Map ans, java.util.Map srcans)
          Adds the value of _annots, Map(String annotName, AnnotImpl).
 void addAnnotation(java.lang.String annotName, java.util.Map annotAttrs)
          Adds an annotation.
 void addAnnotation(java.lang.String propName, java.lang.String annotName, java.util.Map annotAttrs)
          Adds an annotation to a proeprty.
 java.lang.Object clone()
          Clones this annotation map.
 java.util.List getAnnotatedProperties()
          Returns a read-only list of the name (String) of properties that are associated at least one annotation (never null).
 java.util.List getAnnotatedPropertiesBy(java.lang.String annotName)
          Returns a read-only list of the names (String) of the properties that are associated with the specified annotation (never null).
 Annotation getAnnotation(java.lang.String annotName)
          Returns the annotation associated with the component definition, or null if not available.
 Annotation getAnnotation(java.lang.String propName, java.lang.String annotName)
          Returns the annotation associated with the definition of the specified property, or null if not available.
 java.util.Collection getAnnotations()
          Returns a read-only collection of all annotations associated with the component definition (never null).
 java.util.Collection getAnnotations(java.lang.String propName)
          Returns a read-only collection of all annotations associated with the definition of the specified property (never null).
 boolean isEmpty()
          Returns whether no annotation at all.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationMap

public AnnotationMap()
Method Detail

isEmpty

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


getAnnotation

public Annotation getAnnotation(java.lang.String annotName)
Returns the annotation associated with the component definition, or null if not available.

Parameters:
annotName - the annotation name

getAnnotation

public Annotation getAnnotation(java.lang.String propName,
                                java.lang.String annotName)
Returns the annotation associated with the definition of the specified property, or null if not available.

Parameters:
annotName - the annotation name
propName - the property name, e.g., "value".
Throws:
java.lang.IllegalArgumentException - if propName is null or empty

getAnnotations

public java.util.Collection getAnnotations()
Returns a read-only collection of all annotations associated with the component definition (never null).


getAnnotations

public java.util.Collection getAnnotations(java.lang.String propName)
Returns a read-only collection of all annotations associated with the definition of the specified property (never null).

Parameters:
propName - the property name, e.g., "value".
Throws:
java.lang.IllegalArgumentException - if propName is null or empty

getAnnotatedPropertiesBy

public java.util.List getAnnotatedPropertiesBy(java.lang.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 java.util.List 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.


addAllAns

public static void addAllAns(java.util.Map ans,
                             java.util.Map srcans)
Adds the value of _annots, Map(String annotName, AnnotImpl).


addAnnotation

public void addAnnotation(java.lang.String annotName,
                          java.util.Map annotAttrs)
Adds an annotation.


addAnnotation

public void addAnnotation(java.lang.String propName,
                          java.lang.String annotName,
                          java.util.Map annotAttrs)
Adds an annotation to a proeprty.

Parameters:
propName - the property name.

clone

public java.lang.Object clone()
Clones this annotation map.

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo