Package org.zkoss.zk.ui.metainfo
Class ZkInfo
java.lang.Object
org.zkoss.zk.ui.metainfo.ZkInfo
- All Implemented Interfaces:
Serializable,NodeInfo,Condition
Represents the zk element in a ZUML page.
- Since:
- 3.5.0
- Author:
- tomyeh
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChild(NodeInfo child) Append a childReturns a readonly list of children.Returns the effectiveness condition.Returns the evaluator.Returns the evaluator reference.Returns the page definition, i.e., the root node, or null if not available.Returns the parent, or null if it has no parent.booleanisEffective(Component comp) Used to evaluate whether it is effective.booleanisEffective(Page page) Used to evaluate whether it is effective.booleanremoveChild(NodeInfo child) Removes a child.Object[]resolveCase(Page page, Component comp) Returns the case condition's value, or null if no case is specified (i.e.,withCase()is false.resolveForEach(Page page, Component comp) Returns the forEach object if the forEach attribute is defined (orForEachBranchInfo.setForEach(java.lang.String, java.lang.String, java.lang.String)is called).resolveSwitch(Page page, Component comp) Returns the switch condition's value; evaluate EL expression if any.voidSets the case condition.voidsetCondition(ConditionImpl cond) Sets the effectiveness condition.voidsetForEach(String expr, String begin, String end) Sets the forEach attribute, which is usually an expression.voidsetForEach(String expr, String begin, String end, String step) Sets the forEach attribute, which is usually an expression.voidSets the switch condition.toString()booleanwithCase()Returns whether the case condition is defined.booleanTests if the condition is setbooleanReturns whether the forEach condition is defined.booleanReturns whether the switch condition is defined.
-
Constructor Details
-
ZkInfo
Constructs a ZK info.
-
-
Method Details
-
withSwitch
public boolean withSwitch()Returns whether the switch condition is defined. -
setSwitch
Sets the switch condition.- Parameters:
switchc- the switch condition; EL allowed. Ignored if null. Note: if it is an empty string, the switch condition (returned byresolveSwitch(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)) is an empty string.
-
resolveSwitch
Returns the switch condition's value; evaluate EL expression if any.Note: unlike
resolveCase(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component), it might return null even ifwithSwitch()is true. -
withCase
public boolean withCase()Returns whether the case condition is defined. -
setCase
Sets the case condition. -
resolveCase
Returns the case condition's value, or null if no case is specified (i.e.,withCase()is false. It evaluates EL expression if any. -
toString
-
resolveForEach
Returns the forEach object if the forEach attribute is defined (orForEachBranchInfo.setForEach(java.lang.String, java.lang.String, java.lang.String)is called).If comp is not null, both pagedef and page are ignored. If comp is null, page must be specified.
- Parameters:
page- the page. It is used only if comp is null.comp- the component.- Returns:
- the forEach object to iterate this info multiple times, or null if this info shall be interpreted only once.
-
setForEach
Sets the forEach attribute, which is usually an expression.- Parameters:
expr- the expression to return a collection of objects, or null/empty to denote no iteration.
-
setForEach
Sets the forEach attribute, which is usually an expression.- Parameters:
expr- the expression to return a collection of objects, or null/empty to denote no iteration.- Since:
- 8.0.0
-
withForEach
public boolean withForEach()Returns whether the forEach condition is defined. -
getCondition
Returns the effectiveness condition. -
setCondition
Sets the effectiveness condition. -
withCondition
public boolean withCondition()Tests if the condition is set -
appendChild
Description copied from interface:NodeInfoAppend a child- Specified by:
appendChildin interfaceNodeInfo
-
removeChild
Description copied from interface:NodeInfoRemoves a child.- Specified by:
removeChildin interfaceNodeInfo
-
getChildren
Description copied from interface:NodeInfoReturns a readonly list of children.Note: the returned list is readonly. To modify, please use
NodeInfo.appendChild(org.zkoss.zk.ui.metainfo.NodeInfo)andNodeInfo.removeChild(org.zkoss.zk.ui.metainfo.NodeInfo)instead.- Specified by:
getChildrenin interfaceNodeInfo
-
isEffective
Description copied from interface:ConditionUsed to evaluate whether it is effective.- Specified by:
isEffectivein interfaceCondition- Parameters:
comp- used as the self variable. Ignored if null.
-
isEffective
Description copied from interface:ConditionUsed to evaluate whether it is effective.- Specified by:
isEffectivein interfaceCondition- Parameters:
page- used as the self variable. Ignored if null.
-
getEvaluatorRef
Description copied from interface:NodeInfoReturns the evaluator reference.- Specified by:
getEvaluatorRefin interfaceNodeInfo
-
getPageDefinition
Description copied from interface:NodeInfoReturns the page definition, i.e., the root node, or null if not available.- Specified by:
getPageDefinitionin interfaceNodeInfo
-
getEvaluator
Description copied from interface:NodeInfoReturns the evaluator.All nodes in the same ZUML tree has the same evaluator reference (inherited from the root node,
PageDefinition.getEvaluatorRef()).- Specified by:
getEvaluatorin interfaceNodeInfo
-
getParent
Description copied from interface:NodeInfoReturns the parent, or null if it has no parent.
-