Package org.eclipse.birt.report.model.api.elements.structures

# Class FilterCondition

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.FilterCondition

All Implemented Interfaces:
  `Cloneable`, `IStructure`, `org.eclipse.birt.report.model.core.IPropertySet`

public class FilterCondition extends org.eclipse.birt.report.model.core.PropertyStructure
Represents one filter in the filter list of List, Table or their Groups.

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 filter condition has the following properties:

Column
  a filter condition has a required column.
Operator
  a filter condition has a required operator to compute.
Filter Expr
  a filter condition has a required filter expression to test. Can be a column or a complete boolean expression.
Value 1 Expr
  a filter condition has an optional value 1 expression of the comparison value for all but unary operators.
Value 2 Expr
  a filter condition has an optional value 2 expression of the second comparison value for trinary operators(between, not between).

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CUSTOM_VALUE`
Name of the member to save the any other user specified value.
`static final String`
`DYNAMIC_FILTER_PARAMETER_MEMBER`
Name of the member that indicates the name of the dynamic filter parameter to reference.
`static final String`
`EXPR_MEMBER`
Name of the filter expression member.
`static final String`
`EXTENSION_EXPR_ID_MEMBER`
Name of the member that indicates the unique id of a custom filter expression contributed and defined by the extension.
`static final String`
`EXTENSION_NAME_MEMBER`
Name of the member that indicates the extension name defined to map to a BIRT filter operator.
`static final String`
`FILTER_COND_STRUCT`
Name of this structure.
`static final String`
`FILTER_TARGET_MEMBER`
Name of the filter target member.
`static final String`
`IS_OPTIONAL_MEMBER`
Name of the member that indicates whether this filter is optional or not.
`static final String`
`OPERATOR_MEMBER`
Name of the filter operator member.
`static final String`
`PUSH_DOWN_MEMBER`
Name of the member that indicates if the current filter condition will be pushed down to the database.
`static final String`
`TYPE_MEMBER`
Name of the member that indicates the type of this filter condition.
`static final String`
`UPDATE_AGGREGATION_MEMBER`
Name of the member that indicates if the current filter condition need to update aggregation.
`static final String`
`VALUE1_MEMBER`
Name of the filter value 1 expression member.
`static final String`
`VALUE2_MEMBER`
Name of the filter value 2 expression member.

### Fields inherited from class org.eclipse.birt.report.model.core.PropertyStructure

`propValues`

## Constructor Summary

Constructors
Constructor
Description
`FilterCondition()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getColumn()`
Deprecated.
This property has been removed.
`String`
`getCustomValue()`
Returns the user specified value.
`String`
`getDynamicFilterParameter()`
Returns the name of the dynamic filter parameter to reference when the filter condition is dynamic.
`String`
`getExpr()`
Returns the filter expression.
`String`
`getExtensionExprId()`
Returns the id of a custom filter expression contributed and defined by the extension identified in the consumerExpressionMapping.
`String`
`getExtensionName()`
Returns the unique id of an org.eclipse.datatools.connectivity.oda.filterExpressions extension to whose custom expressions are defined to map to a BIRT filter operator.
`String`
`getFilterExpr()`
Deprecated.
Replaced by the method `getExpr()`
`String`
`getFilterTarget()`
Returns the filter target.
`String`
`getOperator()`
Returns the operator.
`String`
`getStructName()`
Returns the name of the structure definition.
`String`
`getType()`
Returns the type.
`String`
`getValue1()`
Returns the value 1 expression.
`String`
`getValue1Expr()`
Deprecated.
Replaced by the method `getValue1()`
`List`
`getValue1ExpressionList()`
Gets the value1 expression list of this filter condition.
`List`
`getValue1List()`
Deprecated.
`getValue1ExpressionList()`
`String`
`getValue2()`
Returns the value 2 expression.
`String`
`getValue2Expr()`
Deprecated.
Replaced by the method `getValue2()`
`StructureHandle`
`handle(SimpleValueHandle valueHandle, int index)`
Creates the specific handle of this structure.
`boolean`
`isOptional()`
Determines whether this filter condition is optional or not.
`boolean`
`pushDown()`
Indicate if the current filter condition will be pushed down to the database.
`void`
`setColumn(String column)`
Deprecated.
This property has been removed.
`void`
`setCustomValue(String customValue)`
Sets the user specified value.
`void`
`setDynamicFilterParameter(String parameterName)`
Sets the name of the dynamic filter parameter to reference.
`void`
`setExpr(String expr)`
Sets the filter expression.
`void`
`setExtensionExprId(String extensionExprId)`
Sets the id of a custom filter expression contributed and defined by the extension identified in the consumerExpressionMapping.
`void`
`setExtensionName(String extensionName)`
Sets the unique id of an org.eclipse.datatools.connectivity.oda.filterExpressions extension to whose custom expressions are defined to map to a BIRT filter operator.
`void`
`setFilterExpr(String filterExpr)`
Deprecated.
Replaced by the method `setExpr(String)`
`void`
`setFilterTarget(String filterTarget)`
Sets the filter target.
`void`
`setOperator(String operator)`
Sets the operator.
`void`
`setOptional(boolean isOptional)`
Sets the optional status for this filter condition.
`void`
`setPushDown(boolean pushDown)`
Sets the push down status for this filter condition
`void`
`setType(String type)`
Sets the type.
`void`
`setUpdateAggregation(boolean updateAggregation)`
Sets the updateAggregation flag of the filter condition.
`void`
`setValue1(String value1)`
Sets the value 1 expression.
`void`
`setValue1(List value1List)`
Sets the value 1 expression.
`void`
`setValue1Expr(String value1Expr)`
Deprecated.
Replaced by the method `setValue1(String)`
`void`
`setValue2(String value2)`
Sets the value 2 expression.
`void`
`setValue2(Expression value)`
Sets the value 2 expression.
`void`
`setValue2Expr(String value2Expr)`
Deprecated.
Replaced by the method `setValue2(String)`
`boolean`
`updateAggregation()`
Checks if this filter condition needs to update aggregation.
`List`
`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, setProperty`

### Methods 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`

### Methods inherited from class java.lang.Object

`finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### FILTER_COND_STRUCT

public static final String FILTER_COND_STRUCT
Name of this structure. Matches the definition in the meta-data dictionary.

See Also:
  - Constant Field Values

### OPERATOR_MEMBER

public static final String OPERATOR_MEMBER
Name of the filter operator member.

See Also:
  - Constant Field Values

### EXPR_MEMBER

public static final String EXPR_MEMBER
Name of the filter expression member.

See Also:
  - Constant Field Values

### VALUE1_MEMBER

public static final String VALUE1_MEMBER
Name of the filter value 1 expression member.

See Also:
  - Constant Field Values

### VALUE2_MEMBER

public static final String VALUE2_MEMBER
Name of the filter value 2 expression member.

See Also:
  - Constant Field Values

### FILTER_TARGET_MEMBER

public static final String FILTER_TARGET_MEMBER
Name of the filter target member.

See Also:
  - Constant Field Values

### IS_OPTIONAL_MEMBER

public static final String IS_OPTIONAL_MEMBER
Name of the member that indicates whether this filter is optional or not.

See Also:
  - Constant Field Values

### EXTENSION_NAME_MEMBER

public static final String EXTENSION_NAME_MEMBER
Name of the member that indicates the extension name defined to map to a BIRT filter operator.

See Also:
  - Constant Field Values

### EXTENSION_EXPR_ID_MEMBER

public static final String EXTENSION_EXPR_ID_MEMBER
Name of the member that indicates the unique id of a custom filter expression contributed and defined by the extension.

See Also:
  - Constant Field Values

### PUSH_DOWN_MEMBER

public static final String PUSH_DOWN_MEMBER
Name of the member that indicates if the current filter condition will be pushed down to the database.

See Also:
  - Constant Field Values

### DYNAMIC_FILTER_PARAMETER_MEMBER

public static final String DYNAMIC_FILTER_PARAMETER_MEMBER
Name of the member that indicates the name of the dynamic filter parameter to reference.

See Also:
  - Constant Field Values

### TYPE_MEMBER

public static final String TYPE_MEMBER
Name of the member that indicates the type of this filter condition. We define some choices for it.

See Also:
  - `DesignChoiceConstants.CHOICE_FILTER_CONDITION_TYPE`
  - Constant Field Values

### UPDATE_AGGREGATION_MEMBER

public static final String UPDATE_AGGREGATION_MEMBER
Name of the member that indicates if the current filter condition need to update aggregation.

See Also:
  - Constant Field Values

### CUSTOM_VALUE

public static final String CUSTOM_VALUE
Name of the member to save the any other user specified value.

See Also:
  - Constant Field Values

## Constructor Details

### FilterCondition

public FilterCondition()

## Method Details

### getStructName

public String getStructName()
Description copied from interface: `IStructure`
Returns 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.

### getExpr

public String getExpr()
Returns the filter expression.

Returns:
  the filter expression

### setExpr

public void setExpr(String expr)
Sets the filter expression.

Parameters:
  `expr` - the filter expression to set

### getOperator

public String getOperator()
Returns the operator. The possible values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_OPERATOR_EQ`
- `FILTER_OPERATOR_NE`
- `FILTER_OPERATOR_LT`
- `FILTER_OPERATOR_LE`
- `FILTER_OPERATOR_GE`
- `FILTER_OPERATOR_GT`
- `FILTER_OPERATOR_BETWEEN`
- `FILTER_OPERATOR_NOT_BETWEEN`
- `FILTER_OPERATOR_NULL`
- `FILTER_OPERATOR_NOT_NULL`
- `FILTER_OPERATOR_TRUE`
- `FILTER_OPERATOR_FALSE`
- `FILTER_OPERATOR_LIKE`
- `FILTER_OPERATOR_TOP_N`
- `FILTER_OPERATOR_BOTTOM_N`
- `FILTER_OPERATOR_TOP_PERCENT`
- `FILTER_OPERATOR_BOTTOM_PERCENT`
- `FILTER_OPERATOR_ANY`

Returns:
  the operator

### setOperator

public void setOperator(String operator)
Sets the operator. The allowed values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_OPERATOR_EQ`
- `FILTER_OPERATOR_NE`
- `FILTER_OPERATOR_LT`
- `FILTER_OPERATOR_LE`
- `FILTER_OPERATOR_GE`
- `FILTER_OPERATOR_GT`
- `FILTER_OPERATOR_BETWEEN`
- `FILTER_OPERATOR_NOT_BETWEEN`
- `FILTER_OPERATOR_NULL`
- `FILTER_OPERATOR_NOT_NULL`
- `FILTER_OPERATOR_TRUE`
- `FILTER_OPERATOR_FALSE`
- `FILTER_OPERATOR_LIKE`
- `FILTER_OPERATOR_TOP_N`
- `FILTER_OPERATOR_BOTTOM_N`
- `FILTER_OPERATOR_TOP_PERCENT`
- `FILTER_OPERATOR_BOTTOM_PERCENT`
- `FILTER_OPERATOR_ANY`

Parameters:
  `operator` - the operator to set

### getValue1

public String getValue1()
Returns the value 1 expression.

Returns:
  the value 1 expression

### getValue1List

@Deprecated public List getValue1List()
Deprecated.
`getValue1ExpressionList()`
Gets the value1 expression list of this filter condition. For most filter operator, there is only one expression in the returned list. However, filter operator 'in' may contain more than one expression.

Returns:
  the value1 expression list of this filter condition.

### getValue1ExpressionList

public List getValue1ExpressionList()
Gets the value1 expression list of this filter condition. For most filter operator, there is only one expression in the returned list. However, filter operator 'in' may contain more than one expression.

Returns:
  the value1 expression list of this filter condition. Each item is `Expression` object.

### setValue1

public void setValue1(String value1)
Sets the value 1 expression.

Parameters:
  `value1` - the value 1 expression to set

### setValue1

public void setValue1(List value1List)
Sets the value 1 expression.

Parameters:
  `value1List` - the value 1 expression list to set

### getValue2

public String getValue2()
Returns the value 2 expression.

Returns:
  the value 2 expression

### setValue2

public void setValue2(String value2)
Sets the value 2 expression.

Parameters:
  `value2` - the value 2 expression to set

### 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 filter expression is required.

Overrides:
  `validate` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `module` - the module
  `element` - the element contains this structure
Returns:
  the semantic error list
See Also:
  - `Structure.validate(Module, org.eclipse.birt.report.model.core.DesignElement)`

### handle

public StructureHandle handle(SimpleValueHandle valueHandle, int index)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Creates the specific handle of this structure. This handle is always created.

Specified by:
  `handle` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `valueHandle` - the value handle of this structure list property this structure is in
  `index` - the position of this structure in structure list
Returns:
  the handle of this structure.

### getColumn

@Deprecated public String getColumn()
Deprecated.
This property has been removed.
Returns the column name of this filter condition.

Returns:
  `null`. NOT support any more.

### setColumn

@Deprecated public void setColumn(String column)
Deprecated.
This property has been removed.
Sets the column name of this filter condition. NOT support any more.

Parameters:
  `column` - the column name to set

### getFilterExpr

@Deprecated public String getFilterExpr()
Deprecated.
Replaced by the method `getExpr()`
Returns the filter expression.

Returns:
  the filter expression.

### setFilterExpr

@Deprecated public void setFilterExpr(String filterExpr)
Deprecated.
Replaced by the method `setExpr(String)`
Sets the filter expression.

Parameters:
  `filterExpr` - the filter expression to set

### getValue1Expr

@Deprecated public String getValue1Expr()
Deprecated.
Replaced by the method `getValue1()`
Returns the value 1 expression of this filter condition.

Returns:
  the expression of value 1.

### setValue1Expr

@Deprecated public void setValue1Expr(String value1Expr)
Deprecated.
Replaced by the method `setValue1(String)`
Sets the value 1 expression of this filter condition.

Parameters:
  `value1Expr` - the value 1 expression to set

### getValue2Expr

@Deprecated public String getValue2Expr()
Deprecated.
Replaced by the method `getValue2()`
Returns the value 2 expression of this filter condition.

Returns:
  the expression of value 1..

### setValue2Expr

@Deprecated public void setValue2Expr(String value2Expr)
Deprecated.
Replaced by the method `setValue2(String)`
Sets the value 2 expression of this filter condition.

Parameters:
  `value2Expr` - the value 2 expression to set

### getFilterTarget

public String getFilterTarget()
Returns the filter target. The possible values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_TARGET_DATA_SET`
- `FILTER_TARGET_RESULT_SET`

Returns:
  the operator

### setFilterTarget

public void setFilterTarget(String filterTarget)
Sets the filter target. The allowed values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_TARGET_DATA_SET`
- `FILTER_TARGET_RESULT_SET`

Parameters:
  `filterTarget` - the filter target to set

### isOptional

public boolean isOptional()
Determines whether this filter condition is optional or not.

Returns:
  true if this filter is optional, otherwise false

### setOptional

public void setOptional(boolean isOptional)
Sets the optional status for this filter condition.

Parameters:
  `isOptional` - true if this filter is optional, otherwise false

### getExtensionName

public String getExtensionName()
Returns the unique id of an org.eclipse.datatools.connectivity.oda.filterExpressions extension to whose custom expressions are defined to map to a BIRT filter operator.

Returns:
  the extension name

### getExtensionExprId

public String getExtensionExprId()
Returns the id of a custom filter expression contributed and defined by the extension identified in the consumerExpressionMapping.

Returns:
  the extension expression id

### pushDown

public boolean pushDown()
Indicate if the current filter condition will be pushed down to the database. Default value is false. Only the oda extension provider supported operators can be pushed down to database. For those only BIRT supported operators even this property is set to true, will be ignored.

Returns:
  true if the current filter condition will be pushed down to the database, otherwise false.

### getDynamicFilterParameter

public String getDynamicFilterParameter()
Returns the name of the dynamic filter parameter to reference when the filter condition is dynamic.

Returns:
  the name to the dynamic filter parameter to reference.

### setExtensionName

public void setExtensionName(String extensionName)
Sets the unique id of an org.eclipse.datatools.connectivity.oda.filterExpressions extension to whose custom expressions are defined to map to a BIRT filter operator.

Parameters:
  `extensionName` - the extension name to set

### setExtensionExprId

public void setExtensionExprId(String extensionExprId)
Sets the id of a custom filter expression contributed and defined by the extension identified in the consumerExpressionMapping.

Parameters:
  `extensionExprId` - the id to set

### setPushDown

public void setPushDown(boolean pushDown)
Sets the push down status for this filter condition

Parameters:
  `pushDown` - true if the current filter condition will be pushed down to the database, otherwise false.

### setDynamicFilterParameter

public void setDynamicFilterParameter(String parameterName)
Sets the name of the dynamic filter parameter to reference.

Parameters:
  `parameterName` - the name of the dynamic filter parameter to set

### getType

public String getType()
Returns the type. The possible values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_CONDITION_TYPE_SLICER`
- `FILTER_CONDITION_TYPE_SIMPLE`

Returns:
  the operator

### setType

public void setType(String type)
Sets the type. The allowed values are defined in `DesignChoiceConstants`, and they are:

- `FILTER_CONDITION_TYPE_SLICER`
- `FILTER_CONDITION_TYPE_SIMPLE`

Parameters:
  `type` - the type to set

### setValue2

public void setValue2(Expression value)
Sets the value 2 expression.

Parameters:
  `value1List` - the value 2 expression list to set

### updateAggregation

public boolean updateAggregation()
Checks if this filter condition needs to update aggregation.

Returns:
  the flag to indicate updating aggregation or not.

### setUpdateAggregation

public void setUpdateAggregation(boolean updateAggregation)
Sets the updateAggregation flag of the filter condition.

Parameters:
  `updateAggregation` - the updateAggregation flag to set
Throws:
  `SemanticException`

### getCustomValue

public String getCustomValue()
Returns the user specified value.

Returns:
  the flag to indicate updating aggregation or not.

### setCustomValue

public void setCustomValue(String customValue)
Sets the user specified value.