Class ZScriptInfo

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

    public class ZScriptInfo
    extends java.lang.Object
    Represents a zscript element.
    Since:
    6.0.0
    Author:
    tomyeh
    See Also:
    Serialized Form
    • Constructor Detail

      • ZScriptInfo

        public ZScriptInfo​(NodeInfo parent,
                           java.lang.String zslang,
                           java.lang.String content,
                           ConditionImpl cond)
        Creates a ZScriptInfo with the content directly.
        Parameters:
        zslang - the scripting language. If null, it is the same as Page.getZScriptLanguage().
        content - the zscript content
      • ZScriptInfo

        public ZScriptInfo​(NodeInfo parent,
                           java.lang.String zslang,
                           java.net.URL url,
                           ConditionImpl cond)
        Create a ZScriptInfo with an URL that is used to load the content.
        Parameters:
        url - the URL to load the content of zscript.
      • ZScriptInfo

        public ZScriptInfo​(NodeInfo parent,
                           java.lang.String zslang,
                           java.lang.String url,
                           Locator locator,
                           ConditionImpl cond)
        Constructs a ZScriptInfo with an URL, which might contain an EL expression.
        Parameters:
        url - the URL. It may contain XEL expressions.
        locator - the locator used to locate the zscript file
    • Method Detail

      • getZScript

        public ZScript getZScript()
        Returns the ZScript object hold in this info.
      • getLanguage

        public java.lang.String getLanguage()
        Returns the scripting language, or null if the default scripting language is preferred.
      • setLanguage

        public void setLanguage​(java.lang.String zslang)
        Sets the scripting language.
        Parameters:
        zslang - the scripting language. If null, the default scripting language is assume.
      • isDeferred

        public boolean isDeferred()
        Returns whether the evaluation of the zscript shall be deferred.
      • setDeferred

        public void setDeferred​(boolean deferred)
        Sets whether the evaluation of the zscript shall be deferred.

        Default: false.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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: 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