|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.metainfo.Property
public class Property
Information about how to initialize a property (a.k.a., a field of a component).
There are two kind of properties: one is a String instance (either
a string value or an expression), and the other is
a NativeInfo
instance. The later is also called the native content.
Constructor Summary | |
---|---|
Property(EvaluatorRef evalr,
java.lang.String name,
NativeInfo value,
ConditionImpl cond)
Constructs a property with the native content. |
|
Property(EvaluatorRef evalr,
java.lang.String name,
java.lang.String value,
ConditionImpl cond)
Constructs a property with a class that is known in advance. |
Method Summary | |
---|---|
void |
assign(Component comp)
Assigns the value of this member to the specified component. |
static void |
assign(Component comp,
java.lang.String name,
java.lang.String value)
Assigns a property. |
ConditionImpl |
getCondition()
Returns the effectiveness condition. |
EvaluatorRef |
getEvaluatorRef()
Returns the evaluator reference. |
java.lang.String |
getName()
Returns the name of the property. |
java.lang.String |
getRawValue()
Returns the raw value of the property. |
java.lang.Object |
getValue(Component comp)
Evaluates the value to an Object. |
java.lang.Object |
getValue(Page page)
Evaluates the value to an Object. |
boolean |
isEffective(Component comp)
Used to evaluate whether it is effective. |
boolean |
isEffective(Page page)
Used to evaluate whether it is effective. |
static java.lang.reflect.Method |
resolveMethod(java.lang.Class cls,
java.lang.String name)
Resolves the method for the specified property, or null if DynamicPropertied.setDynamicProperty(java.lang.String, java.lang.Object) shall be used instead. |
void |
setCondition(ConditionImpl cond)
Sets the effectiveness condition. |
void |
setRawValue(java.lang.String value)
Sets the raw value of the property. |
java.lang.String |
toString()
|
boolean |
withCondition()
Tests if the condition is set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Property(EvaluatorRef evalr, java.lang.String name, java.lang.String value, ConditionImpl cond)
java.lang.IllegalArgumentException
- if name is nullpublic Property(EvaluatorRef evalr, java.lang.String name, NativeInfo value, ConditionImpl cond)
NativeInfo
,
i.e., a XML fragment (a.k.a., a tree of ComponentInfo
.
Method Detail |
---|
public java.lang.String getName()
public java.lang.String getRawValue()
java.lang.UnsupportedOperationException
- if value is the native content,
i.e., it is constructed by use of Property(EvaluatorRef, String, NativeInfo, ConditionImpl)
.public void setRawValue(java.lang.String value)
java.lang.UnsupportedOperationException
- if value is the native content,
i.e., it is constructed by use of Property(EvaluatorRef, String, NativeInfo, ConditionImpl)
.public java.lang.Object getValue(Component comp)
isEffective(org.zkoss.zk.ui.Component)
and it doesn't coerce
the result (i.e., Object.class is assumed).
public java.lang.Object getValue(Page page)
isEffective(org.zkoss.zk.ui.Component)
and it doesn't coerce
the result (i.e., Object.class is assumed).
java.lang.UnsupportedOperationException
- if value is the native content,
i.e., it is constructed by use of Property(EvaluatorRef, String, NativeInfo, ConditionImpl)
.public void assign(Component comp)
Note: this method does nothing if isEffective(org.zkoss.zk.ui.Component)
returns false.
public java.lang.String toString()
toString
in class java.lang.Object
public static final java.lang.reflect.Method resolveMethod(java.lang.Class cls, java.lang.String name) throws PropertyNotFoundException
DynamicPropertied.setDynamicProperty(java.lang.String, java.lang.Object)
shall be used instead.
Use this method to retrieve the method when you want to assign a value to a component's property.
Don't use the reflection directly since this method searches more signatures.
name
- the property name, such as "title".
PropertyNotFoundException
- if the property is not found,
i.e., no corresponding method and DynamicPropertied
not
implemented.public static final void assign(Component comp, java.lang.String name, java.lang.String value)
Don't use the reflection directly since this method searches more signatures.
PropertyNotFoundException
- if the property is not found,
i.e., no corresponding method and DynamicPropertied
not
implemented.
UiException
- if fail to assignpublic EvaluatorRef getEvaluatorRef()
public ConditionImpl getCondition()
public void setCondition(ConditionImpl cond)
public boolean withCondition()
public boolean isEffective(Component comp)
Condition
isEffective
in interface Condition
comp
- used as the self variable. Ignored if null.public boolean isEffective(Page page)
Condition
isEffective
in interface Condition
page
- used as the self variable. Ignored if null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |