Filter Operator

The Filter Operator compares each value of a multi-valued property of string type with one or more string values. Each time that the result of a comparison is true, the value of the multi-valued property is stored in a specified multi-valued property associated with the comparison. Each time that the result of a comparison is false, the value of the multi-valued property is rejected and stored in a specified multi-valued property.

Note: If a value of the multi-valued property matches several string values, the value is stored in the specified multi-valued properties associated with the comparisons for which the result is true.

Example

You want to filter a multi-valued property that contains the following values:

Each value of this multi-valued property is compared with the comparison values that are shown in the next table. When the result of a comparison is true, the value is stored in the property associated to the comparison (ImageFolder, TextFolder, and so on). If a value of the multi-valued property does not match any string values, the value is stored in the property "RejectedValues".

Property Name

Comparator

Comparison Value

ImageFolder

starts with

image

TextFolder

starts with

text

AudioFolder

starts with

audio

JpegImageFolder

contains

jpeg

GifImageFolder

contains

gif

Once the Filter Operator have completed the comparisons, each property contains the following list:

ImageFolder

TextFolder

AudioFolder

JpegImageFolder

GifImageFolder

image/jpeg:2500

image/jpeg:4000

image/jpeg:5000

image/gif:4000

image/gif:10000

text/plain:100

audio/mp3:20000

image/jpeg:2500

image/jpeg:4000

image/jpeg:5000

image/gif:4000

image/gif:10000

The value "Message:20" does not match any string values. This value is thus stored in the multi-valued property "RejectedValues".

Identification area

Name: Type the name of the component (mandatory).

Description: Allows you to type the description of the component (optional).

Definition tab

Source: Allows you to select a multi-valued property that you want to filter.

Target: Allows you to create the table of comparisons that filters the selected multi-valued property.

(*) Note: The last two comparisons use regular expressions that you should know. These regular expressions are compliant with the POSIX standard. For more information about regular expressions, consult the relevant J2SE websites:

 

The following table shows the regular expressions (Regex) that are equivalent to the most used wildcards:

Wildcard

Regex

Comment

*

.*

Represents a number of characters (including zero or more characters). If you type "cd*" or "cd.*", you can retrieve "cda", "cdrom", "cdrecord" and anything that starts with "cd", "cd" itself included.

?

.

Represents a single character. If you type something like "hd?" or "hd.", you can retrieve hda, hdb, hdc and every other letter/number between a-z, 0-9.

[]

[]

Specifies a range. If you type m[aou]m, this expression can become: mam, mum, mom. If you type m[a-d]m, this expression can become anything that starts and ends with m and has a character a to d in-between. For example: mam, mbm, mcm, mdm. This kind of wildcard specifies an "or" relationship.

\

\

Represents an "escape" character, which role is to protect a subsequent special character. Thus, "\\" searches for a backslash.