public abstract class SearchTerm<T>
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
SearchTerm()
Initializes a new
SearchTerm |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
accept(SearchTermVisitor visitor)
Handles given visitor for this search term.
|
abstract void |
addMailField(java.util.Collection<MailField> col)
Adds the addressed MailField to specified collection
|
boolean |
containsWildcard()
Checks if this search term's pattern contains wildcard characters
'*' and '?' |
SearchTerm<?> |
filter(java.lang.Class<? extends SearchTerm>[] filter)
Generates a search term with the unsupported search terms specified through
filter removed. |
SearchTerm<?> |
filter(java.util.Set<java.lang.Class<? extends SearchTerm>> filterSet)
Generates a search term with the unsupported search terms specified through
filter removed. |
abstract javax.mail.search.SearchTerm |
getJavaMailSearchTerm()
Generates the corresponding JavaMail instance of
SearchTerm from this search term |
abstract javax.mail.search.SearchTerm |
getNonWildcardJavaMailSearchTerm()
Generates the corresponding instance of
SearchTerm from this search term without any wildcard characters. |
abstract T |
getPattern()
Gets the pattern to which the expression should match.
|
boolean |
isAscii()
Checks if this search term's pattern only consists of ASCII 7 bit characters.
|
abstract boolean |
matches(MailMessage mailMessage)
Checks if specified mail message matches this search term
|
abstract boolean |
matches(javax.mail.Message msg)
Checks if given message matches this search term
|
public SearchTerm()
SearchTermpublic abstract T getPattern()
public abstract void accept(SearchTermVisitor visitor)
visitor - The visitorpublic abstract void addMailField(java.util.Collection<MailField> col)
col - The collection which gathers addressed fieldspublic abstract boolean matches(javax.mail.Message msg)
throws com.openexchange.exception.OXException
msg - The message to checktrue if message matches this search term; otherwise falsecom.openexchange.exception.OXException - If check failspublic abstract boolean matches(MailMessage mailMessage) throws com.openexchange.exception.OXException
mailMessage - The mail message to checktrue if specified mail message matches this search term; otherwise falsecom.openexchange.exception.OXException - If checking mail message against search term failspublic abstract javax.mail.search.SearchTerm getJavaMailSearchTerm()
SearchTerm from this search termSearchTermpublic abstract javax.mail.search.SearchTerm getNonWildcardJavaMailSearchTerm()
SearchTerm from this search term without any wildcard characters.
This is useful to preselect possible positives and to manually filtering out false positives.
SearchTerm without any wildcard characters.containsWildcard()public SearchTerm<?> filter(java.lang.Class<? extends SearchTerm>[] filter)
filter removed.
For each search term contained in this search term the following rule is applied:
ORTerm or ANDTerm replace the unsupported with:
BooleanTerm.FALSE for ORTerm and
BooleanTerm.TRUE for ANDTermBooleanTerm.FALSE for both ORTerm and ANDTermBooleanTerm.FALSENote: Only a shallow copy is generated; meaning further working on this search term may influence return value's search term.
filter - An array containing unsupported classes of SearchTerm to filter againstpublic SearchTerm<?> filter(java.util.Set<java.lang.Class<? extends SearchTerm>> filterSet)
filter removed.
For each search term contained in this search term the following rule is applied:
ORTerm or ANDTerm replace the unsupported with:
BooleanTerm.FALSE for ORTerm and
BooleanTerm.TRUE for ANDTermBooleanTerm.FALSE for both ORTerm and ANDTermBooleanTerm.FALSENote: Only a shallow copy is generated; meaning further working on this search term may influence return value's search term.
filterSet - The filter set containing classes unsupported search termspublic boolean isAscii()
This method implies that this search is some kind of string search term. Returns true if not appropriate.
true if search term's pattern only consists of ASCII 7 bit characters; otherwise falsepublic boolean containsWildcard()
'*' and '?'.
This method implies that this search is some kind of string search term. Returns false if not appropriate.
true if this search term's pattern contains wildcard characters; otherwise false