FilterExpression
that represents a filter for a single field.
When this is applied, only those records that match the specified criteria will be returned,
those that don't are filtered out.
Field filter examples:
Operator | Example | |
---|---|---|
{@link caplin.grid.filter.FieldFilterExpression.Operator#EQUAL EQUAL} | Currency=USD |
Filters out all records that do not have a value of USD for their Currency field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#NOT_EQUAL NOT_EQUAL} | Currency!=USD |
Filters out all records that have a value of USD for their Currency field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#GREATER_THAN GREATER_THAN} | Bid>100 |
Filters out all records that do not have a value greater than 100 for their Bid field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#GREATER_THAN_OR_EQUAL GREATER_THAN_OR_EQUAL} | Bid>=100 |
Filters out all records that do not have a value greater than or equal to 100 for their Bid field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#LESS_THAN LESS_THAN} | Bid<100 |
Filters out all records that do not have a value less than 100 for their Bid field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#LESS_THAN_OR_EQUAL LESS_THAN_OR_EQUAL} | Bid<=100 |
Filters out all records that do not have a value less than or equal to 100 for their Bid field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#REGULAR_EXPRESSION REGULAR_EXPRESSION} | Currency~^(USD|EUR)$ |
Filters out all records that do not have a value of USD or EUR for their Currency field |
{@link caplin.grid.filter.FieldFilterExpression.Operator#CASE_INSENSITIVE_REGULAR_EXPRESSION CASE_INSENSITIVE_REGULAR_EXPRESSION} | Issuer#.*Gov.* |
Filters out all records that do not have a value that contains the text Gov, regardless of case, for their Issuer field |
Attributes | Name and Description |
---|---|
|
caplin.grid.filter.FieldFilterExpression(String name, String operator, String value, String (optional), String (optional))
Constructs a new |
Attributes | Name and Description |
---|---|
|
String
getFieldName()
Gets the field name which this filter applies to |
|
String
getFilterKey()
Returns a textual key that represents the operator used by this expression. |
|
String
getOperator()
Returns the operator |
<static>
|
String
getOperatorForFieldKey( fieldKey)
Returns the FieldFilterExpression operator that relates to the given key. |
|
String
getRttpState()
Gets the serialized representation of this |
|
String
getSerializedState(String indent)
Gets the XML representation of this |
|
String
getUserInputtedValue()
Returns the value the user typed into the filter input box if this filter was created by user input. |
|
String
getValue()
Returns the value |
|
boolean
isMutuallyExclusiveWith(FieldFilterExpression filterExpression)
Indicates whether this filter is mutually exclusive with the given filter. |
<static>
|
boolean
isValidFieldKey( fieldKey)
Indicates whether the given key maps to a valid |
|
boolean
matchesFilterKey( filterName)
Indicated whether this FieldFilterExpression matches the filter name given. |
|
void
setValue( value)
Sets the value |
|
void
toMap()
Construct map representing the filter. |
|
String
toString()
Gets a text representation of the field filter expression. |
►
caplin.grid.filter.FieldFilterExpression(String name, String operator, String value, String (optional), String (optional))
Constructs a new FieldFilterExpression
with the specified field name, operator and
value.
String | name | The name of the field to be filtered. |
String | operator | The operator to be used for the filter. This must be one values defined by the caplin.grid.filter.FieldFilterExpression.Operator enumeration. |
String | value | The value to be operated against. |
String | (optional) | primaryFieldType The type of the field, can be used to set custom filter types. |
String | (optional) | userInputtedValue The value the user typed into a filter input. |
►
String
getFieldName()
Gets the field name which this filter applies to
►
String
getFilterKey()
Returns a textual key that represents the operator used by this expression.
►
String
getOperator()
Returns the operator
►
<static>
String
getOperatorForFieldKey( fieldKey)
Returns the FieldFilterExpression operator that relates to the given key. This is a compatibility function
to provide a mapping between operators and GridColumnFilter
filter names.
fieldKey | The filter key to map |
►
String
getRttpState()
Gets the serialized representation of this FieldFilterExpression
which is understood
by the Container Filtering Module used by Transformer.
►
String
getSerializedState(String indent)
Gets the XML representation of this FieldFilterExpression
that will be used to save
it within a serialized component and/or layout.
String | indent | The number of characters the caller would like the expression to indent the XML it returns to make it easily human readable. |
►
String
getUserInputtedValue()
Returns the value the user typed into the filter input box if this filter was created by user input. A RegExp string may be converted from what is seen in the GUI to a string containing ^.*& etc and the grid on deserializing will need the original value to place into the input box, this method provides it.
►
String
getValue()
Returns the value
►
boolean
isMutuallyExclusiveWith(FieldFilterExpression filterExpression)
Indicates whether this filter is mutually exclusive with the given filter. Filters are mutually exclusive if they both share a mutually exclusive operator. The mutually exclusive operators are LESS THAN (OR EQUAL), GREATER THAN (OR EQUAL), EQUAL and NOT EQUAL.
FieldFilterExpression | filterExpression | The filter to compare with this one |
►
<static>
boolean
isValidFieldKey( fieldKey)
Indicates whether the given key maps to a valid FieldFilterExpression
operator.
fieldKey | The filter key to check |
►
boolean
matchesFilterKey( filterName)
Indicated whether this FieldFilterExpression matches the filter name given. This is for backwards compatibility with GridColumnFilters.
filterName | The filter name to check |
►
void
setValue( value)
Sets the value
value | The new value for the filter |
►
void
toMap()
Construct map representing the filter. Used by InputControls
►
String
toString()
Gets a text representation of the field filter expression.