|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.ui.metainfo.impl.AnnotationHelper
public class AnnotationHelper
A helper class used to parse annotations.
How to use:
add(java.lang.String, java.util.Map)
, addByRawValue(java.lang.String, java.lang.String)
,
or addByCompoundValue(java.lang.String)
to add annotations to this helper.applyAnnotations(org.zkoss.zk.ui.metainfo.ComponentInfo, java.lang.String, boolean)
to update the annotations to the specified component info.
Constructor Summary | |
---|---|
AnnotationHelper()
|
Method Summary | |
---|---|
void |
add(java.lang.String annotName,
java.util.Map annotAttrs)
Adds an annotation definition. |
void |
addByCompoundValue(java.lang.String cval)
Adds annotation by specifying the content in the compound format: annot-name(att1-name=att1-value, att2-name=att2-value) . |
void |
addByRawValue(java.lang.String annotName,
java.lang.String rawValue)
Adds an annotation by specify the value in the raw format: att1-name=att1-value, att2-name = att2-value . |
void |
applyAnnotations(ComponentInfo compInfo,
java.lang.String propName,
boolean clear)
Applies the annotations defined in this helper to the specified instance definition. |
void |
applyAnnotations(Component comp,
java.lang.String propName,
boolean clear)
Applies the annotations defined in this helper to the specified component. |
boolean |
clear()
Clears the annotations defined in this helper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationHelper()
Method Detail |
---|
public void add(java.lang.String annotName, java.util.Map annotAttrs)
annotName
- the annotation name.annotAttrs
- a map of attributes of the annotation. If null,
it means no attribute at all.addByRawValue(java.lang.String, java.lang.String)
,
addByCompoundValue(java.lang.String)
public void addByRawValue(java.lang.String annotName, java.lang.String rawValue)
att1-name=att1-value, att2-name = att2-value
.
public void addByCompoundValue(java.lang.String cval)
annot-name(att1-name=att1-value, att2-name=att2-value)
.
public void applyAnnotations(ComponentInfo compInfo, java.lang.String propName, boolean clear)
compInfo
- the instance definition to updatepropName
- the property nameclear
- whether to clear all definitions before returningclear()
public void applyAnnotations(Component comp, java.lang.String propName, boolean clear)
comp
- the component to updatepropName
- the property nameclear
- whether to clear all definitions before returningclear()
public boolean clear()
The annotations are defined by add(java.lang.String, java.util.Map)
, addByRawValue(java.lang.String, java.lang.String)
,
or addByCompoundValue(java.lang.String)
.
add(java.lang.String, java.util.Map)
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |