Class AbstractExpression

    • Constructor Detail

      • AbstractExpression

        protected AbstractExpression()
        Creates an unnamed expression. Make sure the name of the expression is set using setName(java.lang.String) before the expression is added to the report's expression collection.
    • Method Detail

      • getName

        public String getName()
        Returns the name of the expression.
        Specified by:
        getName in interface Expression
        Returns:
        the name.
      • setName

        public void setName​(String name)
        Sets the name of the expression.

        The name should be unique among:

        • the functions and expressions for the report;
        • the columns in the report's TableModel;
        This allows the expression to be referenced by name from any report element.

        You should not change the name of an expression once it has been added to the report's expression collection.

        Specified by:
        setName in interface Expression
        Parameters:
        name - the name (null not permitted).
      • isActive

        public final boolean isActive()
        Deprecated.
        The Active-Flag is no longer evaluated. We always assume it to be true.
        Returns true if this expression contains "auto-active" content and should be called by the system regardless of whether this expression is referenced in the DataRow.
        Specified by:
        isActive in interface Expression
        Returns:
        true as all expressions are always evaluated now.
      • setActive

        public final void setActive​(boolean active)
        Deprecated.
        All expressions are always active. This method has no effect anymore.
        Defines, whether the expression is an active expression. This method has no effect anymore.
        Parameters:
        active - a flag.
      • getDependencyLevel

        public int getDependencyLevel()
        Returns the dependency level for the expression (controls evaluation order for expressions and functions).
        Specified by:
        getDependencyLevel in interface Expression
        Returns:
        the level.
      • setDependencyLevel

        public void setDependencyLevel​(int level)
        Sets the dependency level for the expression.

        The dependency level controls the order of evaluation for expressions and functions. Higher level expressions are evaluated before lower level expressions. Any level in the range 0 to Integer.MAX_VALUE is allowed. Negative values are reserved for system functions (printing and layouting).

        Specified by:
        setDependencyLevel in interface Expression
        Parameters:
        level - the level (must be greater than or equal to 0).
      • clone

        public Object clone()
                     throws CloneNotSupportedException
        Clones the expression. The expression should be reinitialized after the cloning.

        Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.

        Specified by:
        clone in interface Expression
        Overrides:
        clone in class Object
        Returns:
        a clone of this expression.
        Throws:
        CloneNotSupportedException - this should never happen.
      • getInstance

        public Expression getInstance()
        Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.
        Specified by:
        getInstance in interface Expression
        Returns:
        a copy of this function.
      • getResourceBundleFactory

        public ResourceBundleFactory getResourceBundleFactory()
        Description copied from interface: Expression
        Returns the resource-bundle factory of the report. This factory encapsulates the Locale and allows to create a resource-bundle in a implementation-independent way.
        Specified by:
        getResourceBundleFactory in interface Expression
        Returns:
        the resource-bundle factory.
      • getReportConfiguration

        public org.pentaho.reporting.libraries.base.config.Configuration getReportConfiguration()
        Description copied from interface: Expression
        Returns the report's current configuration.
        Specified by:
        getReportConfiguration in interface Expression
        Returns:
        the configuration of the report.
      • setRuntime

        public void setRuntime​(ExpressionRuntime runtime)
        Defines the ExpressionRune used in this expression. The ExpressionRuntime is set before the expression receives events or gets evaluated and is unset afterwards. Do not hold references on the runtime or you will create memory-leaks.
        Specified by:
        setRuntime in interface Expression
        Parameters:
        runtime - the runtime information for the expression
      • getRuntime

        public ExpressionRuntime getRuntime()
        Returns the ExpressionRune used in this expression. The ExpressionRuntime is set before the expression receives events or gets evaluated and is unset afterwards. Do not hold references on the runtime or you will create memory-leaks.
        Specified by:
        getRuntime in interface Expression
        Returns:
        the runtime information for the expression
      • isDeepTraversing

        public boolean isDeepTraversing()
        Checks whether this expression is a deep-traversing expression. Deep-traversing expressions receive events from all sub-reports. This returns false by default, as ordinary expressions have no need to be deep-traversing.
        Specified by:
        isDeepTraversing in interface Expression
        Returns:
        false.
      • isPreserve

        public boolean isPreserve()
        Checks whether this expression's last value is preserved after the expression goes out of scope.
        Specified by:
        isPreserve in interface Expression
        Returns:
        true, if the expression's last value is preserved, false otherwise.
      • setPreserve

        public void setPreserve​(boolean preserve)
        Defines, whether this expression's last value is preserved after the expression goes out of scope.
        Parameters:
        preserve - true, if the expression's last value is preserved, false otherwise.