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 Argument
protected Argument
protected Argument
flag
(jakarta.mail.search.FlagTerm term) protected Argument
generateSequence
(jakarta.mail.search.SearchTerm term, String charset) Generate the IMAP search sequence for the given search expression.protected Argument
static boolean
isAscii
(jakarta.mail.search.SearchTerm term) Check if the "text" terms in the given SearchTerm contain non US-ASCII characters.static boolean
isAscii
(jakarta.mail.search.SearchTerm[] terms) Check if any of the "text" terms in the given SearchTerms contain non US-ASCII characters.static boolean
Does this string contain only ASCII characters?protected Argument
protected Argument
Generate argument for ModifiedSinceTerm.protected Argument
protected Argument
Generate argument for OlderTerm.protected Argument
protected Argument
receiveddate
(jakarta.mail.search.DateTerm term) protected Argument
protected Argument
sentdate
(jakarta.mail.search.DateTerm term) protected Argument
size
(jakarta.mail.search.SizeTerm term) protected Argument
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(jakarta.mail.search.SearchTerm term, String charset) throws jakarta.mail.search.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:
jakarta.mail.search.SearchException
- for failuresIOException
- for I/O errors
-
isAscii
public static boolean isAscii(jakarta.mail.search.SearchTerm term) 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
public static boolean isAscii(jakarta.mail.search.SearchTerm[] terms) 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
protected Argument and(jakarta.mail.search.AndTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
or
protected Argument or(jakarta.mail.search.OrTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
not
protected Argument not(jakarta.mail.search.NotTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
header
protected Argument header(jakarta.mail.search.HeaderTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
messageid
protected Argument messageid(jakarta.mail.search.MessageIDTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
flag
protected Argument flag(jakarta.mail.search.FlagTerm term) throws jakarta.mail.search.SearchException - Throws:
jakarta.mail.search.SearchException
-
from
protected Argument from(String address, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
recipient
protected Argument recipient(jakarta.mail.Message.RecipientType type, String address, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
subject
protected Argument subject(jakarta.mail.search.SubjectTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
body
protected Argument body(jakarta.mail.search.BodyTerm term, String charset) throws jakarta.mail.search.SearchException, IOException - Throws:
jakarta.mail.search.SearchException
IOException
-
size
protected Argument size(jakarta.mail.search.SizeTerm term) throws jakarta.mail.search.SearchException - Throws:
jakarta.mail.search.SearchException
-
toIMAPDate
-
sentdate
protected Argument sentdate(jakarta.mail.search.DateTerm term) throws jakarta.mail.search.SearchException - Throws:
jakarta.mail.search.SearchException
-
receiveddate
protected Argument receiveddate(jakarta.mail.search.DateTerm term) throws jakarta.mail.search.SearchException - Throws:
jakarta.mail.search.SearchException
-
older
Generate argument for OlderTerm.- Parameters:
term
- the search term- Returns:
- the SEARCH Argument
- Throws:
jakarta.mail.search.SearchException
- for failures- Since:
- JavaMail 1.5.1
-
younger
Generate argument for YoungerTerm.- Parameters:
term
- the search term- Returns:
- the SEARCH Argument
- Throws:
jakarta.mail.search.SearchException
- for failures- Since:
- JavaMail 1.5.1
-
modifiedSince
Generate argument for ModifiedSinceTerm.- Parameters:
term
- the search term- Returns:
- the SEARCH Argument
- Throws:
jakarta.mail.search.SearchException
- for failures- Since:
- JavaMail 1.5.1
-