Class TemplateInfo

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

public class TemplateInfo extends Object
Represent a template element.
Since:
6.0.0
Author:
tomyeh
See Also:
  • Constructor Details

    • TemplateInfo

      public TemplateInfo(NodeInfo parent, String name, String src, Map<String,String> params, ConditionImpl cond)
      Creates a template.
      Parameters:
      parent - the parent node (never null)
      name - the name of the template (never null)
      params - the map of parameters. Igored if null.
  • Method Details

    • getName

      public String getName()
      Returns the name of the template info.
    • getSrc

      public String getSrc(Component comp)
      Returns the URI to create the template from, or null if not specified.
    • getParameters

      public Map<String,ExValue> getParameters()
      Returns a readonly map of the parameters that are assigned to the template.
      Since:
      10.0.0
    • resolveParameters

      public Map<String,Object> resolveParameters(Component comp)
      Evaluates and returns a readonly map of parameters assigned to this template (never null).
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isAnnotationNamespacedRoot

      public boolean isAnnotationNamespacedRoot()
      Returns:
      whether this TemplateInfo is the first TemplateInfo that has annotation namespace or binding annotation.
      Since:
      8.5.2
    • setAnnotationNamespacedRoot

      public void setAnnotationNamespacedRoot(boolean annotationNamespacedRoot)
      Sets whether this TemplateInfo is the first TemplateInfo that has annotation namespace or binding annotation.
      Parameters:
      annotationNamespacedRoot -
      Since:
      8.5.2
    • getCondition

      public ConditionImpl getCondition()
      Returns the effectiveness condition.
    • setCondition

      public void setCondition(ConditionImpl cond)
      Sets the effectiveness condition.
    • withCondition

      public boolean withCondition()
      Tests if the condition is set
    • 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
    • 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
    • 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