Package org.jfree.report.expressions
Class AbstractExpression
- java.lang.Object
-
- org.jfree.report.expressions.AbstractExpression
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Expression
- Direct Known Subclasses:
ColumnAggregationExpression,FormulaExpression,FormulaFunction,GetValueExpression,GroupByExpression,IsEmptyDataExpression,IsEmptyExpression,IsEndOfDataExpression,IsExportTypeExpression,IsNullExpression
public abstract class AbstractExpression extends java.lang.Object implements Expression
A baseclass for simple, non-positionally parametrized expressions.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clones the expression, expression should be reinitialized after the cloning.protected DataRowgetDataRow()Returns the currentDataRow.ExpressiongetInstance()Return a new instance of this expression.java.lang.StringgetName()Returns the name of the expression.protected java.util.LocalegetParentLocale()protected org.pentaho.reporting.libraries.base.config.ConfigurationgetReportConfiguration()protected ResourceBundleFactorygetResourceBundleFactory()ExpressionRuntimegetRuntime()booleanisDeepTraversing()A deep-traversing expression declares that it should receive updates from all subreports.booleanisPrecompute()Returns, whether the expression will be precomputed.booleanisPreserve()Checks, whether the expression's result should be preserved in the precomputed value registry.voidsetDeepTraversing(boolean deepTraversing)Defines, whether the expression is deep-traversing.voidsetName(java.lang.String name)Sets the name of the expression.voidsetPrecompute(boolean precompute)Defines, whether the expression will be precomputed.voidsetPreserve(boolean preserve)Defines, whether the expression's result should be preserved in the precomputed value registry.voidsetRuntime(ExpressionRuntime runtime)Defines the DataRow used in this expression.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.report.expressions.Expression
computeValue
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the expression. An expression without a name cannot be referenced from outside the element.- Specified by:
getNamein interfaceExpression- Returns:
- the function name.
-
setName
public void setName(java.lang.String name)
Sets the name of the expression.- Specified by:
setNamein interfaceExpression- Parameters:
name- the name.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClones 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:
clonein interfaceExpression- Overrides:
clonein classjava.lang.Object- Returns:
- A clone of this expression.
- Throws:
java.lang.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:
getInstancein interfaceExpression- 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:
setRuntimein interfaceExpression- Parameters:
runtime- the runtime information for the expression
-
getRuntime
public ExpressionRuntime getRuntime()
-
getResourceBundleFactory
protected ResourceBundleFactory getResourceBundleFactory()
-
getReportConfiguration
protected org.pentaho.reporting.libraries.base.config.Configuration getReportConfiguration()
-
getParentLocale
protected java.util.Locale getParentLocale()
-
isPrecompute
public boolean isPrecompute()
Description copied from interface:ExpressionReturns, 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:
isPrecomputein interfaceExpression- Returns:
- true, if the expression is precomputed, false otherwise.
-
setPrecompute
public void setPrecompute(boolean precompute)
Description copied from interface:ExpressionDefines, 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:
setPrecomputein interfaceExpression- Parameters:
precompute- true, if the expression is precomputed, false otherwise.
-
isDeepTraversing
public boolean isDeepTraversing()
Description copied from interface:ExpressionA 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:
isDeepTraversingin interfaceExpression- Returns:
- true, if the expression is deep-traversing, false otherwise.
-
setDeepTraversing
public void setDeepTraversing(boolean deepTraversing)
Description copied from interface:ExpressionDefines, whether the expression is deep-traversing.- Specified by:
setDeepTraversingin interfaceExpression- Parameters:
deepTraversing- true, if the expression is deep-traversing, false otherwise.
-
isPreserve
public boolean isPreserve()
Description copied from interface:ExpressionChecks, 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:
isPreservein interfaceExpression- Returns:
- true, if the expression's results should be preserved, false otherwise.
-
setPreserve
public void setPreserve(boolean preserve)
Description copied from interface:ExpressionDefines, 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:
setPreservein interfaceExpression- Parameters:
preserve- true, if the expression's results should be preserved, false otherwise.
-
-