Package org.zkoss.zk.ui.metainfo
Class VariablesInfo
- java.lang.Object
-
- org.zkoss.zk.ui.metainfo.VariablesInfo
-
public class VariablesInfo extends java.lang.ObjectThe information about the variables element in the ZUML page.- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VariablesInfo(NodeInfo parent, java.util.Map<java.lang.String,java.lang.String> vars, boolean local, java.lang.String composite, ConditionImpl cond)Constructor.VariablesInfo(NodeInfo parent, java.util.Map<java.lang.String,java.lang.String> vars, boolean local, ConditionImpl cond)The same as VariablesInfo(parent, vars, locale, "none", cond).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendChild(NodeInfo child)Append a childvoidapply(Component comp)Applies the variable element against the parent component.voidapply(Page page)Applies the variable element against the page.java.util.List<NodeInfo>getChildren()Returns a readonly list of children.java.lang.StringgetComposite()Returns the composite type: "none", "list" or "map".EvaluatorgetEvaluator()Returns the evaluator.EvaluatorRefgetEvaluatorRef()Returns the evaluator reference.PageDefinitiongetPageDefinition()Returns the page definition, i.e., the root node, or null if not available.NodeInfogetParent()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.booleanisLocal()Returns if it is for local variable.booleanremoveChild(NodeInfo child)Removes a child.voidsetCondition(ConditionImpl cond)Sets the effectiveness condition.java.lang.StringtoString()booleanwithCondition()Tests if the condition is set
-
-
-
Constructor Detail
-
VariablesInfo
public VariablesInfo(NodeInfo parent, java.util.Map<java.lang.String,java.lang.String> vars, boolean local, java.lang.String composite, ConditionImpl cond)
Constructor.- Parameters:
vars- a map of (String name, String value). Note: once called, the caller cannot access it any more. In other words, it becomes part of this object.local- whether they are local variables.composite- indicates the composite type. It can be one of "none", "list" or "map". If null or empty, "none" is assumed.- Throws:
java.lang.IllegalArgumentException- if the composite type is illegal.- Since:
- 3.0.6
-
VariablesInfo
public VariablesInfo(NodeInfo parent, java.util.Map<java.lang.String,java.lang.String> vars, boolean local, ConditionImpl cond)
The same as VariablesInfo(parent, vars, locale, "none", cond).- Parameters:
vars- a map of (String name, String value). Note: once called, the caller cannot access it any more. In other words, it becomes part of this object.local- whether they are local variables.
-
-
Method Detail
-
isLocal
public boolean isLocal()
Returns if it is for local variable.- Since:
- 3.0.6
-
getComposite
public java.lang.String getComposite()
Returns the composite type: "none", "list" or "map".- Since:
- 3.0.6
-
apply
public void apply(Component comp)
Applies the variable element against the parent component.- Parameters:
comp- the parent component (it cannot be null)
-
apply
public void apply(Page page)
Applies the variable element against the page. It is called if the element doesn't belong to any component.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setCondition
public void setCondition(ConditionImpl cond)
Sets the effectiveness condition.
-
withCondition
public boolean withCondition()
Tests if the condition is set
-
isEffective
public boolean isEffective(Component comp)
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
public boolean isEffective(Page page)
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
public EvaluatorRef getEvaluatorRef()
Description copied from interface:NodeInfoReturns the evaluator reference.- Specified by:
getEvaluatorRefin interfaceNodeInfo
-
getPageDefinition
public PageDefinition getPageDefinition()
Description copied from interface:NodeInfoReturns the page definition, i.e., the root node, or null if not available.- Specified by:
getPageDefinitionin interfaceNodeInfo
-
getEvaluator
public Evaluator 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
public NodeInfo getParent()
Description copied from interface:NodeInfoReturns the parent, or null if it has no parent.
-
getChildren
public java.util.List<NodeInfo> 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
-
appendChild
public void appendChild(NodeInfo child)
Description copied from interface:NodeInfoAppend a child- Specified by:
appendChildin interfaceNodeInfo
-
removeChild
public boolean removeChild(NodeInfo child)
Description copied from interface:NodeInfoRemoves a child.- Specified by:
removeChildin interfaceNodeInfo
-
-