Package com.sun.mail.imap.protocol
Class SearchSequence
java.lang.Object
com.sun.mail.imap.protocol.SearchSequence
- Direct Known Subclasses:
GmailSearchSequence
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 Argument
protected Argument
protected Argument
protected Argument
generateSequence
(SearchTerm term, String charset) Generate the IMAP search sequence for the given search expression.protected Argument
header
(HeaderTerm term, String charset) static boolean
Does this string contain only ASCII characters?static boolean
isAscii
(SearchTerm term) Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.static boolean
isAscii
(SearchTerm[] terms) Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.protected Argument
messageid
(MessageIDTerm term, String charset) protected Argument
Generate argument for ModifiedSinceTerm.protected Argument
protected Argument
Generate argument for OlderTerm.protected Argument
protected Argument
receiveddate
(DateTerm term) protected Argument
recipient
(Message.RecipientType type, String address, String charset) protected Argument
protected Argument
protected Argument
subject
(SubjectTerm term, String charset) protected String
toIMAPDate
(Date date) protected Argument
younger
(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:
SearchException
IOException
-
or
- Throws:
SearchException
IOException
-
not
- Throws:
SearchException
IOException
-
header
- Throws:
SearchException
IOException
-
messageid
protected Argument messageid(MessageIDTerm term, String charset) throws SearchException, IOException - Throws:
SearchException
IOException
-
flag
- Throws:
SearchException
-
from
- Throws:
SearchException
IOException
-
recipient
protected Argument recipient(Message.RecipientType type, String address, String charset) throws SearchException, IOException - Throws:
SearchException
IOException
-
subject
- Throws:
SearchException
IOException
-
body
- Throws:
SearchException
IOException
-
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
-