org.abstracthorizon.mercury.imap.util
Class IMAPScanner

java.lang.Object
  extended by org.abstracthorizon.mercury.imap.util.IMAPScanner

public class IMAPScanner
extends Object

A class implementing a lexical scanner for an IMAP server.

Author:
Daniel Sendula

Nested Class Summary
static class IMAPScanner.Number
           
 
Field Summary
protected  char[] buffer
          Buffer
protected  boolean eol
          Have we reached EOL
protected  InputStream in
          Input stream
protected  boolean literal
          Is literal recognised
protected  OutputStream out
          Output stream
protected  int ptr
          Current pointer
 
Constructor Summary
IMAPScanner(InputStream in, OutputStream out)
          Constructor
 
Method Summary
protected  boolean astring_char(char c)
           
 boolean astring(StringBuffer buffer)
           
protected  boolean atom_char(char c)
           
 boolean atom(StringBuffer buffer)
           
 void check_eol()
           
 boolean date_day_fixed(IMAPScanner.Number num)
           
 boolean date_day(IMAPScanner.Number num)
           
 boolean date_month(IMAPScanner.Number num)
           
 boolean date_text(GregorianCalendar calendar)
           
 boolean date_time(GregorianCalendar calendar)
           
 boolean date(GregorianCalendar calendar)
           
protected  boolean digit_nz(char c)
           
protected  boolean digit(char c)
           
 boolean flag_list(javax.mail.Flags fs)
           
 boolean flag(javax.mail.Flags flags)
           
 boolean four_digit(IMAPScanner.Number num)
           
 boolean header_list(List<String> list)
           
 boolean is_char(char r)
           
 boolean keyword(String keyword)
           
protected  boolean list_char(char c)
           
 boolean list_mailbox(StringBuffer buffer)
           
 boolean literal(StringBuffer literal)
           
 boolean mailbox(StringBuffer mailbox)
           
 boolean number(IMAPScanner.Number num)
           
 boolean nz_number(IMAPScanner.Number num)
           
 boolean peek_char(char r)
           
 boolean quoted(StringBuffer quoted)
           
 long raw_literal()
           
 boolean readBase64Line(StringBuffer line)
           
 boolean section_msgtext(PointerSection section)
           
 int section_part(PointerSection section)
           
 boolean section_text(PointerSection section)
           
 boolean section(PointerSection section)
           
 boolean seq_range(SimpleSequence sequence)
           
 boolean sequence_set(ComposedSequence sequence)
           
 void skip_line()
           
 boolean string(StringBuffer buffer)
           
 boolean tag(StringBuffer res)
           
protected  boolean text_char(char c)
           
 boolean time(IMAPScanner.Number hour, IMAPScanner.Number min, IMAPScanner.Number sec)
           
 boolean two_digit(IMAPScanner.Number num)
           
 boolean zone(StringBuffer zone)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected InputStream in
Input stream


out

protected OutputStream out
Output stream


buffer

protected char[] buffer
Buffer


literal

protected boolean literal
Is literal recognised


ptr

protected int ptr
Current pointer


eol

protected boolean eol
Have we reached EOL

Constructor Detail

IMAPScanner

public IMAPScanner(InputStream in,
                   OutputStream out)
Constructor

Parameters:
in - input stream
out - output stream
Method Detail

atom_char

protected boolean atom_char(char c)

astring_char

protected boolean astring_char(char c)

text_char

protected boolean text_char(char c)

digit_nz

protected boolean digit_nz(char c)

digit

protected boolean digit(char c)

list_char

protected boolean list_char(char c)

skip_line

public void skip_line()
               throws IOException
Throws:
IOException

check_eol

public void check_eol()
               throws IOException,
                      ParserException
Throws:
IOException
ParserException

is_char

public boolean is_char(char r)
                throws IOException
Throws:
IOException

peek_char

public boolean peek_char(char r)
                  throws IOException
Throws:
IOException

number

public boolean number(IMAPScanner.Number num)
               throws IOException
Throws:
IOException

nz_number

public boolean nz_number(IMAPScanner.Number num)
                  throws IOException
Throws:
IOException

tag

public boolean tag(StringBuffer res)
            throws IOException
Throws:
IOException

keyword

public boolean keyword(String keyword)
                throws IOException
Throws:
IOException

quoted

public boolean quoted(StringBuffer quoted)
               throws IOException,
                      ParserException
Throws:
IOException
ParserException

literal

public boolean literal(StringBuffer literal)
                throws IOException,
                       ParserException
Throws:
IOException
ParserException

raw_literal

public long raw_literal()
                 throws IOException,
                        ParserException
Throws:
IOException
ParserException

string

public boolean string(StringBuffer buffer)
               throws IOException,
                      ParserException
Throws:
IOException
ParserException

atom

public boolean atom(StringBuffer buffer)
             throws IOException,
                    ParserException
Throws:
IOException
ParserException

astring

public boolean astring(StringBuffer buffer)
                throws IOException,
                       ParserException
Throws:
IOException
ParserException

readBase64Line

public boolean readBase64Line(StringBuffer line)
                       throws IOException,
                              ParserException
Throws:
IOException
ParserException

list_mailbox

public boolean list_mailbox(StringBuffer buffer)
                     throws IOException,
                            ParserException
Throws:
IOException
ParserException

sequence_set

public boolean sequence_set(ComposedSequence sequence)
                     throws IOException,
                            ParserException
Throws:
IOException
ParserException

seq_range

public boolean seq_range(SimpleSequence sequence)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

section

public boolean section(PointerSection section)
                throws IOException,
                       ParserException
Throws:
IOException
ParserException

section_part

public int section_part(PointerSection section)
                 throws IOException,
                        ParserException
Throws:
IOException
ParserException

section_text

public boolean section_text(PointerSection section)
                     throws IOException,
                            ParserException
Throws:
IOException
ParserException

section_msgtext

public boolean section_msgtext(PointerSection section)
                        throws IOException,
                               ParserException
Throws:
IOException
ParserException

header_list

public boolean header_list(List<String> list)
                    throws IOException,
                           ParserException
Throws:
IOException
ParserException

mailbox

public boolean mailbox(StringBuffer mailbox)
                throws IOException,
                       ParserException
Throws:
IOException
ParserException

flag

public boolean flag(javax.mail.Flags flags)
             throws IOException,
                    ParserException
Throws:
IOException
ParserException

flag_list

public boolean flag_list(javax.mail.Flags fs)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

date_day_fixed

public boolean date_day_fixed(IMAPScanner.Number num)
                       throws IOException,
                              ParserException
Throws:
IOException
ParserException

date_day

public boolean date_day(IMAPScanner.Number num)
                 throws IOException,
                        ParserException
Throws:
IOException
ParserException

date_month

public boolean date_month(IMAPScanner.Number num)
                   throws IOException,
                          ParserException
Throws:
IOException
ParserException

four_digit

public boolean four_digit(IMAPScanner.Number num)
                   throws IOException,
                          ParserException
Throws:
IOException
ParserException

two_digit

public boolean two_digit(IMAPScanner.Number num)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

time

public boolean time(IMAPScanner.Number hour,
                    IMAPScanner.Number min,
                    IMAPScanner.Number sec)
             throws IOException,
                    ParserException
Throws:
IOException
ParserException

zone

public boolean zone(StringBuffer zone)
             throws IOException,
                    ParserException
Throws:
IOException
ParserException

date_time

public boolean date_time(GregorianCalendar calendar)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

date_text

public boolean date_text(GregorianCalendar calendar)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

date

public boolean date(GregorianCalendar calendar)
             throws IOException,
                    ParserException
Throws:
IOException
ParserException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.