class sap.ui.mdc.condition.Operator

Visiblity: restricted
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/mdc/condition/Operator
Application Component: CA-UI5-MDC

Creates an sap.ui.mdc.condition.Operator object. This is used in the FilterField control to define which filter operators are supported.

If a function or property is initial, the default implementation is used.


Constructor

new sap.ui.mdc.condition.Operator(oConfiguration)
Param Type Default Value Description
oConfiguration object

Properties of the operator

name string

Name of the operator used in the condition

filterOperator string

The operator's default filter operator that is created as defined in FilterOperator

tokenParse string

The string representation of the regular expression that is used by the operator to parse a value to eliminate the operator and get the data string. A placeholder that refers to the translated tokenText can be used. #tokenText# refers to the oConfiguration.tokenText property if given.

tokenFormat string

The string representation that is used by the operator to format a value into an output string. For the value placeholder {0} and {1} are used. A placeholder that refers to the translated tokenText can be used. #tokenText# refers to the oConfiguration.tokenText property if given.

valueTypes string[] object[]

Array of type to be used. The length of the array defines the number of values that need to be entered with the operator.
If set to Operator.ValueType.Self the Type of the Field or FilterField using the Operator is used.
If set to Operator.ValueType.SelfNoParse same as Operator.ValueType.Self, except that the input value parsing will not be called.
If set to Operator.ValueType.Static a simple string type is used to display static text.
If set to a name of a data type an instance of this data type will be used.
If set to an object with the properties name, formatOptions and constraints an instance of the corresponding data type will be used. The type given via name must be required by the application.

paramTypes? string[]

Array of type parameters regexp

longText? string

String representation of the operator as a long text.
If longText is not given , it is looked up in the resource bundle of the sap.ui.mdc library by the key operators.{oConfiguration.name}.longText

tokenText? string

String representation of the operator as a short text.
If the token text is not given, it is looked up in the resource bundle of the sap.ui.mdc library by the key operators.{oConfiguration.name}.tokenText

displayFormats? object

Pattern how different displayFormats are rendered

format? function

Function to format condition

parse? function

Function to parse input into condition

validate? function

Function to validate condition

getModelFilter? function

Function create filter for a condition

isEmpty? function

Function to check if condition is empty

createControl? function

Function to create a control to be used in DefineConditionPanel

getCheckValue? function

Function to get the value for condition compare

getValues? function

Function to get the real values without operator symbol

checkValidated? function

Function to check if a condition is validated (sets the validated property)

exclude? boolean

If set, the operator is handled as exclude filter when creating the filters of all conditions

validateInput? boolean

If set, the user input for this operator needs to be validated using a field help

additionalInfo? string

additionalInfo text for the operator. Will be shown in the operator suggest as second column. If not used (undefined) the Include or Exclude information of the operator is used.


Methods Overview

Method Description
_createLocalType

Creates a local type.

_parseValue

Parses a text based on the data type.

checkValidated

Checks if a condition is validated and sets the validated flag.

For EQ set validated flag if a description is given.

compareConditions

Compares two conditions

For EQ conditions, only the key part of the values is compared as the text part might be different (if the translation is missing, for example).

sap.ui.mdc.condition.Operator.extend

Creates a new subclass of class sap.ui.mdc.condition.Operator with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

format

Formats a condition.

getCondition

Creates a condition for a given text.

sap.ui.mdc.condition.Operator.getMetadata

Returns a metadata object for class sap.ui.mdc.condition.Operator.

getModelFilter

Creates a filter object for a condition.

getTypeText

Gets the text for an operator name.

getValues

Returns the real values without operator symbol.

In this function no type validation takes place.

isEmpty

Checks if a condition is empty.

isSingleValue

Checks if an Operator contains only one value or not.

For example, an equal Operator has only one value, a between operator two.

parse

Parses a text.

test

Checks if a text is suitable for an operator.

validate

Validates a value.

_createLocalType

Creates a local type.

Param Type DefaultValue Description
vType string object

Type name or object with type information

oType sap.ui.model.Type

original data type

_parseValue

Parses a text based on the data type.

Param Type DefaultValue Description
sValue string

Text

oType sap.ui.model.Type

Data type

checkValidated

Checks if a condition is validated and sets the validated flag.

For EQ set validated flag if a description is given.

Param Type DefaultValue Description
oCondition sap.ui.mdc.condition.ConditionObject

Condition to check

compareConditions

Compares two conditions

For EQ conditions, only the key part of the values is compared as the text part might be different (if the translation is missing, for example).

Param Type DefaultValue Description
oCondition1 sap.ui.mdc.condition.ConditionObject

Condition to check

oCondition2 sap.ui.mdc.condition.ConditionObject

Condition to check

sap.ui.mdc.condition.Operator.extend

Creates a new subclass of class sap.ui.mdc.condition.Operator with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

format

Formats a condition.

Param Type DefaultValue Description
oCondition sap.ui.mdc.condition.ConditionObject

Condition

oType sap.ui.model.Type

Data type

sDisplay string

Display mode

bHideOperator boolean false

If set, only the value output is returned without any visible operator

getCondition

Creates a condition for a given text.

Param Type DefaultValue Description
sText string

Text

oType sap.ui.model.Type

Data type

sDisplayFormat sap.ui.mdc.enum.FieldDisplay

Display format

bDefaultOperator boolean

If true, operator is used as default. In this case parsing without operator also works

sap.ui.mdc.condition.Operator.getMetadata

Returns a metadata object for class sap.ui.mdc.condition.Operator.

getModelFilter

Creates a filter object for a condition.

Param Type DefaultValue Description
oCondition sap.ui.mdc.condition.ConditionObject

Condition

sFieldPath string

Path of filter

oType sap.ui.model.Type

Data type of the used filter field

bCaseSensitive boolean

creates a caseSensitive filter

getTypeText

Gets the text for an operator name.

Param Type DefaultValue Description
sKey string

Text key

sType string

Name of type

getValues

Returns the real values without operator symbol.

In this function no type validation takes place.

Param Type DefaultValue Description
sText string

Text

sDisplayFormat sap.ui.mdc.enum.FieldDisplay

Display format

bDefaultOperator boolean

If true, operator is used as default. In this case parsing without operator also works

isEmpty

Checks if a condition is empty.

Param Type DefaultValue Description
oCondition sap.ui.mdc.condition.ConditionObject

Condition

oType sap.ui.model.Type

Data type

isSingleValue

Checks if an Operator contains only one value or not.

For example, an equal Operator has only one value, a between operator two.

parse

Parses a text.

Param Type DefaultValue Description
sText string

Text

oType sap.ui.model.Type

Data type

sDisplayFormat sap.ui.mdc.enum.FieldDisplay

Display format

bDefaultOperator boolean

If true, operator is used as default. In this case parsing without operator also works

test

Checks if a text is suitable for an operator.

Param Type DefaultValue Description
sText string

Text

validate

Validates a value.

Param Type DefaultValue Description
aValues any

Values

oType sap.ui.model.Type

Data type