org.pentaho.reporting.engine.classic.core.function
Interface Expression

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
AggregationFunction, FieldAggregationFunction, Function, LayoutProcessorFunction, OutputFunction, StructureFunction, ValidateableExpression
All Known Implementing Classes:
AbstractCompareExpression, AbstractElementFormatFunction, AbstractExpression, AbstractFunction, AndExpression, AttributeExpressionsEvaluator, AverageExpression, BSFExpression, BSHExpression, CapitalizeStringExpression, CellFormatFunction, ColumnAggregationExpression, ColumnAverageExpression, ColumnDifferenceExpression, ColumnDivisionExpression, ColumnMaximumExpression, ColumnMinimumExpression, ColumnMultiplyExpression, ColumnSumExpression, CompareDateExpression, CompareFieldsExpression, CompareNumberExpression, CompareStringExpression, ConditionalItemSumFunction, ConvertToDateExpression, ConvertToNumberExpression, CountDistinctFunction, CreateGroupAnchorsFunction, CreateHyperLinksFunction, CrosstabProcessorFunction, CSVWriter, DateCutExpression, DateExpression, DateSpanExpression, DefaultOutputFunction, ElementColorFunction, ElementTrafficLightFunction, ElementVisibilityFunction, ElementVisibilitySwitchFunction, EventMonitorFunction, FormulaExpression, FormulaFunction, GetDataRowValueExpression, GroupCountFunction, HideElementByNameFunction, HideElementIfDataAvailableExpression, HideNullValuesFunction, HidePageBandForTableExportFunction, IsEmptyDataExpression, IsEmptyExpression, IsExportTypeExpression, IsNegativeExpression, IsNullExpression, IsPositiveExpression, ItemAvgFunction, ItemColumnQuotientExpression, ItemCountFunction, ItemHideFunction, ItemMaxFunction, ItemMinFunction, ItemPercentageFunction, ItemSumFunction, MapIndirectExpression, MapStringExpression, MessageFormatExpression, MetaDataStyleEvaluator, NegativeNumberPaintChangeFunction, OrExpression, PageFunction, PageItemCountFunction, PageItemSumFunction, PageOfPagesFunction, PageTotalFunction, PaintComponentFunction, PaintDynamicComponentFunction, PercentageExpression, ResourceBundleLookupExpression, ResourceMesssageFormatExpression, RowBandingFunction, SheetNameFunction, ShowElementByNameFunction, ShowElementIfDataAvailableExpression, SingleValueQueryFunction, StyleExpressionsEvaluator, SubStringExpression, SurveyScaleExpression, TextFormatExpression, TokenizeStringExpression, ToLowerCaseStringExpression, TotalCalculationFunction, TotalGroupCountFunction, TotalGroupSumFunction, TotalGroupSumQuotientFunction, TotalGroupSumQuotientPercentFunction, TotalItemCountFunction, TotalItemMaxFunction, TotalItemMinFunction, TotalPageItemCountFunction, ToUpperCaseStringExpression, TriggerPageFooterFunction, URLEncodeExpression, VariableDateExpression, WizardItemHideFunction, XMLWriter

public interface Expression
extends Cloneable, Serializable

An expression is a lightweight function that does not maintain a state. Expressions are used to calculate values within a single row of a report. Expressions can use a dataRow to access other fields, expressions or functions within the current row in the report.

Author:
Thomas Morgner

Method Summary
 Object clone()
          Clones the expression, expression should be reinitialized after the cloning.
 DataRow getDataRow()
          Returns the DataRow used in this expression.
 int getDependencyLevel()
          The dependency level defines the level of execution for this function.
 Expression getInstance()
          Return a new instance of this expression.
 String getName()
          Returns the name of the expression.
 org.pentaho.reporting.libraries.base.config.Configuration getReportConfiguration()
          Returns the report's current configuration.
 ResourceBundleFactory getResourceBundleFactory()
          Returns the resource-bundle factory of the report.
 ExpressionRuntime getRuntime()
          Retrieves the runtime instance.
 Object getValue()
          Return the current expression value.
 boolean isActive()
          Deprecated. The Active-Flag is no longer evaluated. We always assume it to be true.
 boolean isDeepTraversing()
          Checks whether this expression is a deep-traversing expression.
 boolean isPreserve()
          Checks whether this expression's last value is preserved after the expression goes out of scope.
 void setDependencyLevel(int level)
          Sets the dependency level for the expression.
 void setName(String name)
          Sets the name of the expression.
 void setRuntime(ExpressionRuntime runtime)
          Defines the DataRow used in this expression.
 

Method Detail

getName

String getName()
Returns the name of the expression.

Every expression, function and column in the datamodel within a report is required to have a unique name.

Returns:
the function name.

setName

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

The name must not be null and must be unique within the expressions of the report, if you intend to use this as a global expression. Expressions for style-expressions or attribute-expressions can work without a name.

Parameters:
name - the name.

getValue

Object getValue()
Return the current expression value.

The value depends (obviously) on the expression implementation.

Returns:
the value of the function.

isActive

boolean isActive()
Deprecated. The Active-Flag is no longer evaluated. We always assume it to be true.

Returns true if this expression contains autoactive content and should be called by the system, regardless whether this expression is referenced in the datarow.

Returns:
true, if the expression is activated automaticly, false otherwise.

getDataRow

DataRow getDataRow()
Returns 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.

Returns:
the assigned DataRow for this report processing.

clone

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.

Returns:
A clone of this expression.
Throws:
CloneNotSupportedException - this should never happen.

getDependencyLevel

int getDependencyLevel()
The dependency level defines the level of execution for this function. Higher dependency functions are executed before lower dependency functions. For ordinary functions and expressions, the range for dependencies is defined to start from 0 (lowest dependency possible) to 2^31 (upper limit of int).

Levels below 0 are reserved for system-functionality (printing and layouting).

The level must not change during the report processing, or the result is invalid.

Returns:
the level.

setDependencyLevel

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

Parameters:
level - the level.

getInstance

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.

Returns:
a copy of this function.

getResourceBundleFactory

ResourceBundleFactory getResourceBundleFactory()
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.

Returns:
the resource-bundle factory.

getReportConfiguration

org.pentaho.reporting.libraries.base.config.Configuration getReportConfiguration()
Returns the report's current configuration.

Returns:
the configuration of the report.

setRuntime

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.

Parameters:
runtime - the runtime information for the expression

getRuntime

ExpressionRuntime getRuntime()
Retrieves the runtime instance.

Returns:
the runtime, can be null, if the expression is abused outside of the report processing.

isDeepTraversing

boolean isDeepTraversing()
Checks whether this expression is a deep-traversing expression. Deep-traversing expressions receive events from all sub-reports.

Returns:
the deep-traversing flag.

isPreserve

boolean isPreserve()
Checks whether this expression's last value is preserved after the expression goes out of scope.

Returns:
true, if the expression's last value is preserved, false otherwise.