Class ComputedColumn
java.lang.Object
org.eclipse.birt.report.model.core.Structure
org.eclipse.birt.report.model.core.PropertyStructure
org.eclipse.birt.report.model.api.elements.structures.ComputedColumn
- All Implemented Interfaces:
Cloneable,IStructure,org.eclipse.birt.report.model.core.IPropertySet
public class ComputedColumn
extends org.eclipse.birt.report.model.core.PropertyStructure
Represents one computed column. A computed column is a 'virtual' column
produced as an expression of other columns within the data set.
This is a managed object, meaning that all changes should be made though the command layer so that they can be undone and redone. Each computed column has the following properties:
- Column Name
- a computed column has a required column name.
- Expression
- expression of the computation for the column.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the aggregateOn member.static final StringName of the aggregateOn member.static final StringDeprecated.static final StringName of the allowExport member.static final StringName of arguments of function member.static final StringName of the member that specifies a list of calculation argument for the specific calculation function.static final StringName of the member that specifies the calculation function name.static final StringDeprecated.static final StringName of this structure.static final StringName of the data-type member.static final StringDisplayNameID of the column name member.static final StringDisplayName of the column name member.static final StringName of the expression member.static final StringName of the filter member.static final StringName of the column name member.static final StringName of the member that specifies the reference date type.static final StringName of the member that specifies the reference date value.static final StringName of the member that specifies the expression that returns the name of time dimension.Fields inherited from class org.eclipse.birt.report.model.core.PropertyStructure
propValues -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregateOn(String aggreValue) Adds an aggregate level to the list.voidaddArgument(AggregationArgument argument) Adds an argument to list.voidaddCalculationArgument(CalculationArgument argument) Adds a calculation argument to list.booleanGets the flag which indicates whether the computed column supports export.voidSets the expression used to define this computed column.Returns the expression used to define this computed column.Returns the aggregateOn expression to compute.Returns the list containing levels to be aggregated on.Deprecated.Deprecated.usinggetName()instead.Returns the data type of this column.Returns column display name.Gets column display name id.Returns the expression to compute.Returns the expression used to define this computed column.getName()Returns the column name.Returns the name of the structure definition.handle(SimpleValueHandle valueHandle, int index) Creates the specific handle of this structure.voidremoveAggregateOn(String aggreValue) Removes an aggregate level from the list.voidremoveArgument(AggregationArgument argument) Removes an argument from list.voidremoveCalculationArgument(CalculationArgument argument) Removes a calculation argument from list.voidsetAggregateFunction(String expression) Sets the expression used to define this computed column.voidsetAggregateOn(String aggregateOn) Sets the aggregateOn expression.voidsetAggregrateOn(String aggregateOn) Deprecated.voidsetAllowExport(boolean allowExport) Sets the flag which indicates whether the computed column supports export.voidsetCalculationType(String calculationType) Sets the calculation type.voidsetColumnName(String columnName) Deprecated.usingsetName(String)instead.voidsetDataType(String dataType) Sets the data type of this column.voidsetDisplayName(String columnDisplayName) Sets the column display name.voidsetDisplayNameID(String displayNameID) Sets the column display name id.voidsetExpression(String expression) Sets the expression.voidsetFilterExpression(String expression) Sets the expression used to define this computed column.voidSets the column namevoidsetReferenceDateType(String type) Sets the reference date type.voidSets the reference date value with the expression value.voidsetTimeDimension(String expr) Sets the time dimension expression value.validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Validates this structure.Methods inherited from class org.eclipse.birt.report.model.core.PropertyStructure
clone, getIntrinsicProperty, getLocalProperty, getLocalProperty, setIntrinsicProperty, setPropertyMethods inherited from class org.eclipse.birt.report.model.core.Structure
checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getMemberDefn, getObjectDefn, getProperty, getProperty, getReferencableProperty, getStringProperty, isDesignTime, isReferencable, setContext, setExpressionProperty, setProperty, setupContext, updateReference
-
Field Details
-
COMPUTED_COLUMN_STRUCT
Name of this structure. Matches the definition in the meta-data dictionary.- See Also:
-
NAME_MEMBER
Name of the column name member.- See Also:
-
DISPLAY_NAME_MEMBER
DisplayName of the column name member.- See Also:
-
DISPLAY_NAME_ID_MEMBER
DisplayNameID of the column name member.- See Also:
-
COLUMN_NAME_MEMBER
Deprecated.usingNAME_MEMBERinstead.Name of the column name member.- See Also:
-
EXPRESSION_MEMBER
Name of the expression member.- See Also:
-
DATA_TYPE_MEMBER
Name of the data-type member.- See Also:
-
AGGREGATEON_MEMBER
Name of the aggregateOn member.- See Also:
-
AGGREGRATEON_MEMBER
Deprecated.Name of the aggregateOn member.- See Also:
-
AGGREGATEON_FUNCTION_MEMBER
Name of the aggregateOn member.- See Also:
-
ARGUMENTS_MEMBER
Name of arguments of function member.- See Also:
-
FILTER_MEMBER
Name of the filter member.- See Also:
-
ALLOW_EXPORT_MEMBER
Name of the allowExport member.- See Also:
-
CALCULATION_TYPE_MEMBER
Name of the member that specifies the calculation function name. The function name is defined by customer DB executor.- See Also:
-
CALCULATION_ARGUMENTS_MEMBER
Name of the member that specifies a list of calculation argument for the specific calculation function.- See Also:
-
REFERENCE_DATE_TYPE_MEMBER
Name of the member that specifies the reference date type.- See Also:
-
REFERENCE_DATE_VALUE_MEMBER
Name of the member that specifies the reference date value. It is required when reference date type is fixed date.- See Also:
-
TIME_DIMENSION_MEMBER
Name of the member that specifies the expression that returns the name of time dimension.- See Also:
-
-
Constructor Details
-
ComputedColumn
public ComputedColumn()
-
-
Method Details
-
getStructName
Description copied from interface:IStructureReturns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.- Returns:
- the internal name of the structure a defined in the meta-data dictionary.
-
getColumnName
Deprecated.usinggetName()instead.Returns the column name.- Returns:
- the column name
-
getName
Returns the column name.- Returns:
- the column name
-
getDisplayName
Returns column display name.- Returns:
- column display name.
-
getDisplayNameID
Gets column display name id.- Returns:
- the column display name id.
-
setDisplayName
Sets the column display name.- Parameters:
columnDisplayName- the column display name to set.
-
setDisplayNameID
Sets the column display name id.- Parameters:
displayNameID- the column display name id.
-
setColumnName
Deprecated.usingsetName(String)instead.Sets the column name.- Parameters:
columnName- the column name to set
-
setName
Sets the column name- Parameters:
name- the column name to set.
-
getExpression
Returns the expression to compute.- Returns:
- the expression to compute
-
setExpression
Sets the expression.- Parameters:
expression- the expression to set
-
handle
Description copied from class:org.eclipse.birt.report.model.core.StructureCreates the specific handle of this structure. This handle is always created.- Specified by:
handlein classorg.eclipse.birt.report.model.core.Structure- Parameters:
valueHandle- the value handle of this structure list property this structure is inindex- the position of this structure in structure list- Returns:
- the handle of this structure.
-
validate
public List validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Validates this structure. The following are the rules:- The column name is required.
- Overrides:
validatein classorg.eclipse.birt.report.model.core.Structure- Parameters:
module- the moduleelement- the element contains this structure- Returns:
- the semantic error list
- See Also:
-
Structure.validate(Module, org.eclipse.birt.report.model.core.DesignElement)
-
getDataType
Returns the data type of this column. The possible values are defined inDesignChoiceConstants, and they are:- COLUMN_DATA_TYPE_ANY
- COLUMN_DATA_TYPE_INTEGER
- COLUMN_DATA_TYPE_STRING
- COLUMN_DATA_TYPE_DATETIME
- COLUMN_DATA_TYPE_DECIMAL
- COLUMN_DATA_TYPE_FLOAT
- COLUMN_DATA_TYPE_STRUCTURE
- COLUMN_DATA_TYPE_TABLE
- Returns:
- the data type of this column.
-
setDataType
Sets the data type of this column. The allowed values are defined inDesignChoiceConstants, and they are:- COLUMN_DATA_TYPE_ANY
- COLUMN_DATA_TYPE_INTEGER
- COLUMN_DATA_TYPE_STRING
- COLUMN_DATA_TYPE_DATETIME
- COLUMN_DATA_TYPE_DECIMAL
- COLUMN_DATA_TYPE_FLOAT
- COLUMN_DATA_TYPE_STRUCTURE
- COLUMN_DATA_TYPE_TABLE
- Parameters:
dataType- the data type to set
-
getAggregrateOn
Deprecated.Returns the aggregrateOn expression to compute.- Returns:
- the aggregrateOn expression to compute.
-
setAggregrateOn
Deprecated.Sets the aggregateOn expression.- Parameters:
aggregateOn- the aggregateOn expression to set
-
getAggregateOn
Returns the aggregateOn expression to compute.- Returns:
- the aggregateOn expression to compute.
-
getAggregateOnList
Returns the list containing levels to be aggregated on.- Returns:
- the list containing levels to be aggregated on
-
setAggregateOn
Sets the aggregateOn expression.- Parameters:
aggregateOn- the aggregateOn expression to set
-
addAggregateOn
Adds an aggregate level to the list.- Parameters:
aggreValue- the aggregate name. For listing elements, this can be "All" or the name of a single group.
-
removeAggregateOn
Removes an aggregate level from the list.- Parameters:
aggreValue- the aggregate name. For listing elements, this can be "All" or the name of a single group.
-
getAggregateFunction
Returns the expression used to define this computed column.- Returns:
- the expression used to define this computed column
-
getFilterExpression
Returns the expression used to define this computed column.- Returns:
- the expression used to define this computed column
-
setAggregateFunction
Sets the expression used to define this computed column.- Parameters:
expression- the expression to set- Throws:
SemanticException- value required exception
-
setFilterExpression
Sets the expression used to define this computed column.- Parameters:
expression- the expression to set- Throws:
SemanticException- value required exception
-
clearAggregateOnList
public void clearAggregateOnList()Sets the expression used to define this computed column.- Parameters:
expression- the expression to set- Throws:
SemanticException- value required exception
-
addArgument
Adds an argument to list.- Parameters:
argument- the aggregate function argument
-
removeArgument
Removes an argument from list.- Parameters:
argument- the aggregate function argument
-
allowExport
public boolean allowExport()Gets the flag which indicates whether the computed column supports export.- Returns:
- true if it allows, otherwise false.
-
setAllowExport
public void setAllowExport(boolean allowExport) Sets the flag which indicates whether the computed column supports export.- Parameters:
allowExport- the flag to set
-
setCalculationType
Sets the calculation type.- Parameters:
calculationType-
-
addCalculationArgument
Adds a calculation argument to list.- Parameters:
argument- the calculation argument
-
removeCalculationArgument
Removes a calculation argument from list.- Parameters:
argument- the calculation argument
-
setReferenceDateValue
Sets the reference date value with the expression value. It must be set when reference date type isTODAY.- Parameters:
expr-
-
setReferenceDateType
Sets the reference date type.- Parameters:
offset-
-
setTimeDimension
Sets the time dimension expression value.- Parameters:
expr-
-
NAME_MEMBERinstead.