public class CommandParser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
CommandParser.ATOM_CHARValidator |
protected static interface |
CommandParser.CharacterValidator
Provides the ability to ensure characters are part of a permitted set.
|
protected class |
CommandParser.DigitCharValidator |
protected class |
CommandParser.NoopCharValidator |
Constructor and Description |
---|
CommandParser() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
astring(ImapRequestLineReader request)
Reads an argument of type "astring" from the request.
|
java.lang.String |
atom(ImapRequestLineReader request)
Reads an argument of type "atom" from the request.
|
byte[] |
base64(ImapRequestLineReader request)
Reads a base64 argument from the request.
|
protected void |
consumeChar(ImapRequestLineReader request,
char expected)
Consumes the next character in the request, checking that it matches the
expected one.
|
protected java.lang.String |
consumeLiteral(ImapRequestLineReader request)
Reads an argument of type "literal" from the request, in the format:
"{" charCount "}" CRLF *CHAR8
Note before calling, the request should be positioned so that nextChar
is '{'.
|
protected java.lang.String |
consumeQuoted(ImapRequestLineReader request)
Reads a quoted string value from the request.
|
protected java.lang.String |
consumeWord(ImapRequestLineReader request,
CommandParser.CharacterValidator validator)
Reads the next "word from the request, comprising all characters up to the next SPACE.
|
java.util.Date |
date(ImapRequestLineReader request)
Reads a "date" argument from the request.
|
java.util.Date |
dateTime(ImapRequestLineReader request)
Reads a "date-time" argument from the request.
|
void |
endLine(ImapRequestLineReader request)
Consumes the request up to and including the eno-of-line.
|
javax.mail.Flags |
flagList(ImapRequestLineReader request)
Reads a "flags" argument from the request.
|
protected boolean |
isListWildcard(char chr) |
java.lang.String |
mailbox(ImapRequestLineReader request)
Reads a "mailbox" argument from the request.
|
java.lang.String |
nstring(ImapRequestLineReader request)
Reads an argument of type "nstring" from the request.
|
long |
number(ImapRequestLineReader request)
Reads an argument of type "number" from the request.
|
long |
nzNumber(ImapRequestLineReader request)
Reads an argument of type "nznumber" (a non-zero number)
(NOTE this isn't strictly as per the spec, since the spec disallows
numbers such as "0123" as nzNumbers (although it's ok as a "number".
|
IdRange[] |
parseIdRange(ImapRequestLineReader request)
Reads a "message set" argument, and parses into an IdSet.
|
void |
setFlag(java.lang.String flagString,
javax.mail.Flags flags) |
java.lang.String |
tag(ImapRequestLineReader request)
Reads a command "tag" from the request.
|
public java.lang.String atom(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.lang.String tag(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.lang.String astring(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.lang.String nstring(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.lang.String mailbox(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.util.Date dateTime(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public java.util.Date date(ImapRequestLineReader request) throws ProtocolException
ProtocolException
protected java.lang.String consumeWord(ImapRequestLineReader request, CommandParser.CharacterValidator validator) throws ProtocolException
ProtocolException
protected java.lang.String consumeLiteral(ImapRequestLineReader request) throws ProtocolException
ProtocolException
protected void consumeChar(ImapRequestLineReader request, char expected) throws ProtocolException
ProtocolException
protected java.lang.String consumeQuoted(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public byte[] base64(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public javax.mail.Flags flagList(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public void setFlag(java.lang.String flagString, javax.mail.Flags flags) throws ProtocolException
ProtocolException
public long number(ImapRequestLineReader request) throws ProtocolException
ProtocolException
public long nzNumber(ImapRequestLineReader request) throws ProtocolException
ProtocolException
protected boolean isListWildcard(char chr)
public void endLine(ImapRequestLineReader request) throws ProtocolException
request
- The requestProtocolException
- If characters are encountered before the endLine.public IdRange[] parseIdRange(ImapRequestLineReader request) throws ProtocolException
ProtocolException