Class AbstractExpression

java.lang.Object
org.jfree.report.expressions.AbstractExpression
All Implemented Interfaces:
Serializable, Cloneable, Expression
Direct Known Subclasses:
ColumnAggregationExpression, FormulaExpression, FormulaFunction, GetValueExpression, GroupByExpression, IsEmptyDataExpression, IsEmptyExpression, IsEndOfDataExpression, IsExportTypeExpression, IsNullExpression

public abstract class AbstractExpression extends Object implements Expression
A baseclass for simple, non-positionally parametrized expressions.
Author:
Thomas Morgner
See Also:
  • Constructor Details

    • AbstractExpression

      protected AbstractExpression()
  • Method Details

    • getName

      public String getName()
      Returns the name of the expression. An expression without a name cannot be referenced from outside the element.
      Specified by:
      getName in interface Expression
      Returns:
      the function name.
    • setName

      public void setName(String name)
      Sets the name of the expression.
      Specified by:
      setName in interface Expression
      Parameters:
      name - the name.
    • clone

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

      Expression maintain no state, cloning is done at the beginning of the report processing to disconnect the used 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 new instance of this expression. The copy is initialized and uses the same parameters as the original, but does not share any objects.
      Specified by:
      getInstance in interface Expression
      Returns:
      a copy of this function.
    • setRuntime

      public void setRuntime(ExpressionRuntime runtime)
      Defines the DataRow used in this expression. The dataRow is set when the report processing starts and can be used to access the values of functions, expressions and the reports datasource.
      Specified by:
      setRuntime in interface Expression
      Parameters:
      runtime - the runtime information for the expression
    • getRuntime

      public ExpressionRuntime getRuntime()
    • getDataRow

      protected DataRow getDataRow()
      Returns the current DataRow.
      Returns:
      the data row.
    • getResourceBundleFactory

      protected ResourceBundleFactory getResourceBundleFactory()
    • getReportConfiguration

      protected org.pentaho.reporting.libraries.base.config.Configuration getReportConfiguration()
    • getParentLocale

      protected Locale getParentLocale()
    • isPrecompute

      public boolean isPrecompute()
      Description copied from interface: Expression
      Returns, whether the expression will be precomputed. For precomputed expressions a parallel evaluation process is started and the result to which the expression evaluates before it gets out of scope will be used whenever an other expression queries this expression's value.
      Specified by:
      isPrecompute in interface Expression
      Returns:
      true, if the expression is precomputed, false otherwise.
    • setPrecompute

      public void setPrecompute(boolean precompute)
      Description copied from interface: Expression
      Defines, whether the expression will be precomputed. For precomputed expressions a parallel evaluation process is started and the result to which the expression evaluates before it gets out of scope will be used whenever an other expression queries this expression's value.
      Specified by:
      setPrecompute in interface Expression
      Parameters:
      precompute - true, if the expression is precomputed, false otherwise.
    • isDeepTraversing

      public boolean isDeepTraversing()
      Description copied from interface: Expression
      A deep-traversing expression declares that it should receive updates from all subreports. This mode should be activated if the expression's result depends on values contained in the subreport.
      Specified by:
      isDeepTraversing in interface Expression
      Returns:
      true, if the expression is deep-traversing, false otherwise.
    • setDeepTraversing

      public void setDeepTraversing(boolean deepTraversing)
      Description copied from interface: Expression
      Defines, whether the expression is deep-traversing.
      Specified by:
      setDeepTraversing in interface Expression
      Parameters:
      deepTraversing - true, if the expression is deep-traversing, false otherwise.
    • isPreserve

      public boolean isPreserve()
      Description copied from interface: Expression
      Checks, whether the expression's result should be preserved in the precomputed value registry. This way, the last value for that expression can be retrieved after the report has been finished. The preserve-function will only preserve the last value that has been evaluated before the expression went out of scope.
      Specified by:
      isPreserve in interface Expression
      Returns:
      true, if the expression's results should be preserved, false otherwise.
    • setPreserve

      public void setPreserve(boolean preserve)
      Description copied from interface: Expression
      Defines, whether the expression's result should be preserved in the precomputed value registry. This way, the last value for that expression can be retrieved after the report has been finished.
      Specified by:
      setPreserve in interface Expression
      Parameters:
      preserve - true, if the expression's results should be preserved, false otherwise.