Class TemplateInfo

  • All Implemented Interfaces:
    java.io.Serializable, NodeInfo, Condition

    public class TemplateInfo
    extends java.lang.Object
    Represent a template element.
    Since:
    6.0.0
    Author:
    tomyeh
    See Also:
    Serialized Form
    • 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:
        toString in class java.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
      • 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.
      • 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
      • 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