Package com.sun.mail.imap.protocol
Class SearchSequence
java.lang.Object
com.sun.mail.imap.protocol.SearchSequence
This class traverses a search-tree and generates the
corresponding IMAP search sequence.
Each IMAPProtocol instance contains an instance of this class,
which might be subclassed by subclasses of IMAPProtocol to add
support for additional product-specific search terms.
- Author:
- John Mani, Bill Shannon
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Create a SearchSequence for this IMAPProtocol. -
Method Summary
Modifier and TypeMethodDescriptionprotected Argumentprotected Argumentprotected Argumentprotected ArgumentgenerateSequence(SearchTerm term, String charset) Generate the IMAP search sequence for the given search expression.protected Argumentheader(HeaderTerm term, String charset) static booleanDoes this string contain only ASCII characters?static booleanisAscii(SearchTerm term) Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.static booleanisAscii(SearchTerm[] terms) Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.protected Argumentmessageid(MessageIDTerm term, String charset) protected ArgumentGenerate argument for ModifiedSinceTerm.protected Argumentprotected ArgumentGenerate argument for OlderTerm.protected Argumentprotected Argumentreceiveddate(DateTerm term) protected Argumentrecipient(Message.RecipientType type, String address, String charset) protected Argumentprotected Argumentprotected Argumentsubject(SubjectTerm term, String charset) protected StringtoIMAPDate(Date date) protected Argumentyounger(YoungerTerm term) Generate argument for YoungerTerm.
-
Field Details
-
cal
-
-
Constructor Details
-
SearchSequence
Create a SearchSequence for this IMAPProtocol.- Parameters:
p- the IMAPProtocol object for the server- Since:
- JavaMail 1.6.0
-
SearchSequence
Deprecated.Create a SearchSequence.
-
-
Method Details
-
generateSequence
public Argument generateSequence(SearchTerm term, String charset) throws SearchException, IOException Generate the IMAP search sequence for the given search expression.- Parameters:
term- the search termcharset- charset for the search- Returns:
- the SEARCH Argument
- Throws:
SearchException- for failuresIOException- for I/O errors
-
isAscii
Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.- Parameters:
term- the search term- Returns:
- true if only ASCII
-
isAscii
Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.- Parameters:
terms- the search terms- Returns:
- true if only ASCII
-
isAscii
Does this string contain only ASCII characters?- Parameters:
s- the string- Returns:
- true if only ASCII
-
and
- Throws:
SearchExceptionIOException
-
or
- Throws:
SearchExceptionIOException
-
not
- Throws:
SearchExceptionIOException
-
header
- Throws:
SearchExceptionIOException
-
messageid
protected Argument messageid(MessageIDTerm term, String charset) throws SearchException, IOException - Throws:
SearchExceptionIOException
-
flag
- Throws:
SearchException
-
from
- Throws:
SearchExceptionIOException
-
recipient
protected Argument recipient(Message.RecipientType type, String address, String charset) throws SearchException, IOException - Throws:
SearchExceptionIOException
-
subject
- Throws:
SearchExceptionIOException
-
body
- Throws:
SearchExceptionIOException
-
size
- Throws:
SearchException
-
toIMAPDate
-
sentdate
- Throws:
SearchException
-
receiveddate
- Throws:
SearchException
-
older
Generate argument for OlderTerm.- Parameters:
term- the search term- Returns:
- the SEARCH Argument
- Throws:
SearchException- for failures- Since:
- JavaMail 1.5.1
-
younger
Generate argument for YoungerTerm.- Parameters:
term- the search term- Returns:
- the SEARCH Argument
- Throws:
SearchException- for failures- Since:
- JavaMail 1.5.1
-
modifiedSince
Generate argument for ModifiedSinceTerm.- Parameters:
term- the search term- Returns:
- the SEARCH Argument
- Throws:
SearchException- for failures- Since:
- JavaMail 1.5.1
-