public class Property
extends java.lang.Object
NativeInfo
instance. The later is also called the native content.Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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
|
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
.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 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 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 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.Copyright © 2005-2023 Potix Corporation. All Rights Reserved.