Class VariablesInfo

java.lang.Object
org.zkoss.zk.ui.metainfo.VariablesInfo
All Implemented Interfaces:
Serializable, NodeInfo, Condition

public class VariablesInfo extends Object
The information about the variables element in the ZUML page.
Author:
tomyeh
See Also:
  • Constructor Details

    • VariablesInfo

      public VariablesInfo(NodeInfo parent, Map<String,String> vars, boolean local, 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:
      IllegalArgumentException - if the composite type is illegal.
      Since:
      3.0.6
    • VariablesInfo

      public VariablesInfo(NodeInfo parent, Map<String,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 Details

    • isLocal

      public boolean isLocal()
      Returns if it is for local variable.
      Since:
      3.0.6
    • getComposite

      public 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 String toString()
      Overrides:
      toString in class 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: Condition
      Used to evaluate whether it is effective.
      Specified by:
      isEffective in interface Condition
      Parameters:
      comp - used as the self variable. Ignored if null.
    • isEffective

      public boolean isEffective(Page page)
      Description copied from interface: Condition
      Used to evaluate whether it is effective.
      Specified by:
      isEffective in interface Condition
      Parameters:
      page - used as the self variable. Ignored if null.
    • getEvaluatorRef

      public EvaluatorRef getEvaluatorRef()
      Description copied from interface: NodeInfo
      Returns the evaluator reference.
      Specified by:
      getEvaluatorRef in interface NodeInfo
    • getPageDefinition

      public PageDefinition getPageDefinition()
      Description copied from interface: NodeInfo
      Returns the page definition, i.e., the root node, or null if not available.
      Specified by:
      getPageDefinition in interface NodeInfo
    • getEvaluator

      public Evaluator getEvaluator()
      Description copied from interface: NodeInfo
      Returns the evaluator.

      All nodes in the same ZUML tree has the same evaluator reference (inherited from the root node, PageDefinition.getEvaluatorRef()).

      Specified by:
      getEvaluator in interface NodeInfo
    • getParent

      public NodeInfo getParent()
      Description copied from interface: NodeInfo
      Returns the parent, or null if it has no parent.
      Specified by:
      getParent in interface NodeInfo
    • getChildren

      public List<NodeInfo> getChildren()
      Description copied from interface: NodeInfo
      Returns a readonly list of children.

      Note: the returned list is readonly. To modify, please use NodeInfo.appendChild(org.zkoss.zk.ui.metainfo.NodeInfo) and NodeInfo.removeChild(org.zkoss.zk.ui.metainfo.NodeInfo) instead.

      Specified by:
      getChildren in interface NodeInfo
    • appendChild

      public void appendChild(NodeInfo child)
      Description copied from interface: NodeInfo
      Append a child
      Specified by:
      appendChild in interface NodeInfo
    • removeChild

      public boolean removeChild(NodeInfo child)
      Description copied from interface: NodeInfo
      Removes a child.
      Specified by:
      removeChild in interface NodeInfo