Class ComputedColumnHandle
java.lang.Object
org.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.ValueHandle
org.eclipse.birt.report.model.api.StructureHandle
org.eclipse.birt.report.model.api.ComputedColumnHandle
Represents the handle of computed column. A computed column is a 'virtual'
column produced as an expression of other columns within the data set. It
includes the column name and the expression used to define a computed column.
-
Field Summary
Fields inherited from class org.eclipse.birt.report.model.api.StructureHandle
structContext
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
-
Constructor Summary
ConstructorsConstructorDescriptionComputedColumnHandle
(SimpleValueHandle valueHandle, int index) Constructs the handle of computed column. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAggregateOn
(String aggreValue) Adds an aggregate level to the list.addArgument
(AggregationArgument argument) Adds an arguments to list.addCalculationArgument
(CalculationArgument argument) Adds a calculation argument to list.boolean
Gets the flag which indicates whether the computed column supports export.Returns additional arguments to the aggregate function.Returns a iterator of calculation arguments for specific calculation type.void
Clears the aggregate on list.void
Clears the argument list.Returns the expression used to define this computed column.Returns the aggregateOn expression used to define this computed column.Returns the list containing levels to be aggregated on.Deprecated.Gets the calculation function name.Deprecated.usinggetName()
instead.Returns the data type of this column.Returns column display name.Gets column display name id.Returns the localized text for the computed column.Returns the expression used to define this computed column.Returns the expression used to define this computed column.getName()
Returns the column name.Returns reference date type for the calculation in this column.Gets the expression handle for the reference date value member.Gets the time dimension string value.void
removeAggregateOn
(String aggreValue) Removes an aggregate level from the list.void
removeArgument
(AggregationArgument argument) Removes an arguments from list.void
removeCalculationArgument
(CalculationArgument argument) Removes a calculation argument from list.void
setAggregateFunction
(String expression) Sets the expression used to define this computed column.void
setAggregateOn
(String aggregateOn) Sets the aggregateOn expression used to define this computed column.void
setAggregrateOn
(String aggregateOn) Deprecated.void
setAllowExport
(boolean allowExport) Sets the flag which indicates whether the computed column supports export.void
setCalculationType
(String calculationType) Gets the calculation function name.void
setColumnName
(String columnName) Deprecated.usingsetName(String)
instead.void
setDataType
(String dataType) Sets the data type of this column.void
setDisplayName
(String columnDisplayName) Sets the column display name.void
setDisplayNameID
(String displayNameID) Sets column display name id.void
setExpression
(String expression) Sets the expression used to define this computed column.void
setFilterExpression
(String expression) Sets the expression used to define this computed column.void
Sets the column name.void
setReferenceDateType
(String refDateType) Sets reference date type for the calculation in this column.void
setTimeDimension
(String timeDimension) Sets the time dimension string value.Methods inherited from class org.eclipse.birt.report.model.api.StructureHandle
drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently
Methods inherited from class org.eclipse.birt.report.model.api.ValueHandle
getReference
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
-
Constructor Details
-
ComputedColumnHandle
Constructs the handle of computed column.- Parameters:
valueHandle
- the value handle for computed column list of one propertyindex
- the position of this computed column in the list
-
-
Method Details
-
getColumnName
Deprecated.usinggetName()
instead.Returns the column name.- Returns:
- the column name
-
getDisplayName
Returns column display name.- Returns:
- column display name.
-
getDisplayNameID
Gets column display name id.- Returns:
- column display name id.
-
setDisplayNameID
Sets column display name id.- Parameters:
displayNameID
- the column display name id.- Throws:
SemanticException
-
getDisplayText
Returns the localized text for the computed column. If the localized text for the text resource key is found, it will be returned. Otherwise, the static text will be returned.- Returns:
- the localized display name.
-
getName
Returns the column name.- Returns:
- the column name
-
setColumnName
Deprecated.usingsetName(String)
instead.Sets the column name.- Parameters:
columnName
- the column name to set
-
setDisplayName
Sets the column display name.- Parameters:
columnDisplayName
- the column display name to set.- Throws:
SemanticException
- if the new column display name duplicates with the existed ones.
-
setName
Sets the column name.- Parameters:
columnName
- the column name to set.- Throws:
SemanticException
- if the new column name duplicates with the existed ones.
-
getExpression
Returns the expression used to define this computed column.- Returns:
- the expression used to define this computed column
-
setExpression
Sets the expression used to define this computed column.- Parameters:
expression
- the expression to set- Throws:
SemanticException
- value required exception
-
getAggregrateOn
Deprecated.Returns the aggregateOn expression used to define this computed column.- Returns:
- the aggregateOn expression used to define this computed column
-
setAggregrateOn
Deprecated.Sets the aggregateOn expression used to define this computed column.- Parameters:
aggregateOn
- the aggregateOn expression to set
-
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- Throws:
SemanticException
- if the dataType is not in the choice list.
-
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.- Throws:
SemanticException
-
addArgument
Adds an arguments to list.- Parameters:
argument
- the aggregate function argument- Returns:
- aggregation argument handle.
- Throws:
SemanticException
-
getAggregateFunction
Returns the expression used to define this computed column. The function is one of following values:- DesignChoiceConstants.MEASURE_FUNCTION_SUM
- DesignChoiceConstants.MEASURE_FUNCTION_COUNT
- DesignChoiceConstants.MEASURE_FUNCTION_MIN
- DesignChoiceConstants.MEASURE_FUNCTION_MAX
- Returns:
- the expression used to define this computed column
-
getAggregateOn
Returns the aggregateOn expression used to define this computed column.- Returns:
- the aggregateOn expression used to define this computed column
-
getAggregateOnList
Returns the list containing levels to be aggregated on.- Returns:
- the list containing levels to be aggregated on
-
argumentsIterator
Returns additional arguments to the aggregate function. Each item in the list is instance ofAggregationArgumentHandle
.- Returns:
- a list containing additional arguments
-
getFilterExpression
Returns the expression used to define this computed column.- Returns:
- the expression used to define this computed column
-
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.- Throws:
SemanticException
-
removeArgument
Removes an arguments from list.- Parameters:
argument
- the aggregate function argument- Throws:
SemanticException
-
setAggregateFunction
Sets the expression used to define this computed column. The function is one of following values:- DesignChoiceConstants.MEASURE_FUNCTION_SUM
- DesignChoiceConstants.MEASURE_FUNCTION_COUNT
- DesignChoiceConstants.MEASURE_FUNCTION_MIN
- DesignChoiceConstants.MEASURE_FUNCTION_MAX
- Parameters:
expression
- the expression to set- Throws:
SemanticException
- if theexpression
is not one of above values.
-
setAggregateOn
Sets the aggregateOn expression used to define this computed column.- Parameters:
aggregateOn
- the aggregateOn expression to set
-
setFilterExpression
Sets the expression used to define this computed column.- Parameters:
expression
- the expression to set- Throws:
SemanticException
- value required exception
-
clearAggregateOnList
Clears the aggregate on list.- Throws:
SemanticException
-
clearArgumentList
Clears the argument list.- Throws:
SemanticException
-
allowExport
public boolean allowExport()Gets the flag which indicates whether the computed column supports export.- Returns:
- true if it allows, otherwise false.
-
setAllowExport
Sets the flag which indicates whether the computed column supports export.- Parameters:
allowExport
- the flag to set- Throws:
SemanticException
-
setCalculationType
Gets the calculation function name. The value is defined by customer DB calculation executor.- Parameters:
calculationType
-- Throws:
SemanticException
-
getCalculationType
Gets the calculation function name. The value is defined by customer DB calculation executor.- Returns:
-
calculationArgumentsIterator
Returns a iterator of calculation arguments for specific calculation type. Each item in the list is instance ofCalculationAggregationArgumentHandle
.- Returns:
- a list containing calculation arguments
-
addCalculationArgument
public CalculationArgumentHandle addCalculationArgument(CalculationArgument argument) throws SemanticException Adds a calculation argument to list.- Parameters:
argument
- the calculation argument for specific calculation type- Returns:
- calculation argument handle.
- Throws:
SemanticException
-
removeCalculationArgument
Removes a calculation argument from list.- Parameters:
argument
- the calculation argument- Throws:
SemanticException
-
setReferenceDateType
Sets reference date type for the calculation in this column. The type is one of following values:- DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY
- DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE
- DesignChoiceConstants.REFERENCE_DATE_TYPE_ENDING_DATE_IN_DIMENSION
- Parameters:
refDateType
- the reference date type to set- Throws:
SemanticException
- if therefDateType
is not one of above values.
-
getReferenceDateType
Returns reference date type for the calculation in this column. The type is one of following values:- DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY
- DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE
- DesignChoiceConstants.REFERENCE_DATE_TYPE_ENDING_DATE_IN_DIMENSION
- Returns:
- the reference date type
-
getReferenceDateValue
Gets the expression handle for the reference date value member. Then use the returned handle to do get/set action.- Returns:
-
getTimeDimension
Gets the time dimension string value. It is the name of the referenced time dimension.- Returns:
- the referred time dimension name
-
setTimeDimension
Sets the time dimension string value. It is the name of the referred time dimension element.- Parameters:
timeDimension
-- Throws:
SemanticException
-
getAggregateOn()