Package org.zkoss.zk.ui.metainfo
Class TemplateInfo
- java.lang.Object
-
- org.zkoss.zk.ui.metainfo.TemplateInfo
-
public class TemplateInfo extends java.lang.ObjectRepresent a template element.- Since:
- 6.0.0
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TemplateInfo(NodeInfo parent, java.lang.String name, java.lang.String src, java.util.Map<java.lang.String,java.lang.String> params, ConditionImpl cond)Creates a template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendChild(NodeInfo child)Append a childjava.util.List<NodeInfo>getChildren()Returns a readonly list of children.ConditionImplgetCondition()Returns the effectiveness condition.EvaluatorgetEvaluator()Returns the evaluator.EvaluatorRefgetEvaluatorRef()Returns the evaluator reference.java.lang.StringgetName()Returns the name of the template info.PageDefinitiongetPageDefinition()Returns the page definition, i.e., the root node, or null if not available.java.util.Map<java.lang.String,ExValue>getParameters()Returns a readonly map of the parameters that are assigned to the template.NodeInfogetParent()Returns the parent, or null if it has no parent.java.lang.StringgetSrc(Component comp)Returns the URI to create the template from, or null if not specified.booleanisAnnotationNamespacedRoot()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.java.util.Map<java.lang.String,java.lang.Object>resolveParameters(Component comp)Evaluates and returns a readonly map of parameters assigned to this template (never null).voidsetAnnotationNamespacedRoot(boolean annotationNamespacedRoot)Sets whether this TemplateInfo is the first TemplateInfo that has annotation namespace or binding annotation.voidsetCondition(ConditionImpl cond)Sets the effectiveness condition.java.lang.StringtoString()booleanwithCondition()Tests if the condition is set
-
-
-
Constructor Detail
-
TemplateInfo
public TemplateInfo(NodeInfo parent, java.lang.String name, java.lang.String src, java.util.Map<java.lang.String,java.lang.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 Detail
-
getName
public java.lang.String getName()
Returns the name of the template info.
-
getSrc
public java.lang.String getSrc(Component comp)
Returns the URI to create the template from, or null if not specified.
-
getParameters
public java.util.Map<java.lang.String,ExValue> getParameters()
Returns a readonly map of the parameters that are assigned to the template.- Since:
- 10.0.0
-
resolveParameters
public java.util.Map<java.lang.String,java.lang.Object> resolveParameters(Component comp)
Evaluates and returns a readonly map of parameters assigned to this template (never null).
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.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:NodeInfoAppend a child- Specified by:
appendChildin interfaceNodeInfo
-
removeChild
public boolean removeChild(NodeInfo child)
Description copied from interface:NodeInfoRemoves a child.- Specified by:
removeChildin interfaceNodeInfo
-
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
-
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
-
-