com.genesyslab.ail
Interface FilterLeaf

All Superinterfaces:
FilterTreeElement

public interface FilterLeaf
extends FilterTreeElement

A contact filter leaf used in SearchContactTemplate.

A contact filter leaf contains an expression such as: EMailAddress = myE-Mail@Address.com or primary EMailAddress = myE-Mail@Address.com (the primaryOnly flag is set to true by calling the setPrimaryOnly(boolean) method).

The value of the filter leaf expression is a string composed of:

First, the characters to search must be defined, example: "firstname*" (here '*' is a character that must match, it is not a wilcard). Then this string must be "escaped" using the SearchContactTemplate.normalizeSearchValue(String) method that returns an escaped string. The wildcards LeafWildcard#ANY or LeafWildcard#CHAR can be added to the escaped string. Then this wildcarded expression is set to the filter leaf instance setValue(String).

Note: If the SearchPrimaryValueOnly flag of the SearchContactTemplate is true, the search does not take into account the PrimaryOnly flag of this FilterLeaf.

See Also:
SearchContactTemplate

Nested Class Summary
static class FilterLeaf.LeafOperator
          Constants for the possible operators in filter leaves.
static class FilterLeaf.LeafWildcard
          Constants for the possible wildcards in filter leaves.
 
Method Summary
 ContactAttributeMetaData getContactAttribute()
          Gets the contact attribute meta data of the filter leaf expression.
 FilterLeaf.LeafOperator getOperator()
          Gets the operator of the filter leaf expression.
 boolean getPrimaryOnly()
          Gets the primary status of the filter expression.
 java.lang.String getValue()
          Gets the value of the filter leaf expression.
 void setContactAttribute(ContactAttributeMetaData aCAMD)
          Sets a contact attribute meta data as a variable of the filter leaf expression.
 void setOperator(FilterLeaf.LeafOperator anOper)
          Sets the operator of the filter leaf expression.
 void setPrimaryOnly(boolean primaryOnly)
          Sets the primary status of the filter expression.
 void setValue(java.lang.String aValue)
          Sets the value of the filter leaf expression.
 
Methods inherited from interface com.genesyslab.ail.FilterTreeElement
getParent, isNode
 

Method Detail

setContactAttribute

void setContactAttribute(ContactAttributeMetaData aCAMD)
Sets a contact attribute meta data as a variable of the filter leaf expression.

Parameters:
aCAMD - as ContactAttributeMetaData.

setOperator

void setOperator(FilterLeaf.LeafOperator anOper)
Sets the operator of the filter leaf expression.

Parameters:
anOper - as FilterLeaf.LeafOperator.

setValue

void setValue(java.lang.String aValue)
Sets the value of the filter leaf expression.
This value can be an exact value: FirstName = "John". It can also be a wildcarded value: FirstName = "*on".
Possible wildcards are defined in FilterLeaf.LeafWildcard.

Parameters:
aValue - as String.

setPrimaryOnly

void setPrimaryOnly(boolean primaryOnly)
Sets the primary status of the filter expression. Searching is done only on primary attribute of ContactAttributeMetaData.

Parameters:
primaryOnly - as boolean.

getContactAttribute

ContactAttributeMetaData getContactAttribute()
Gets the contact attribute meta data of the filter leaf expression.

Returns:
contact attribute as ContactAttributeMetaData.

getOperator

FilterLeaf.LeafOperator getOperator()
Gets the operator of the filter leaf expression.

Returns:
the operator as FilterLeaf.LeafOperator.

getValue

java.lang.String getValue()
Gets the value of the filter leaf expression.

Returns:
a value as String.

getPrimaryOnly

boolean getPrimaryOnly()
Gets the primary status of the filter expression.

Returns:
status as boolean.