ittp.protocol.parser
Class ITTPScan

java.lang.Object
  extended byittp.protocol.parser.TokenStream
      extended byittp.protocol.parser.ITTPScan

public class ITTPScan
extends TokenStream

The aim of this class is to scan the request send by the client.

Author:
Frederic Bidon and Mathieu Texier

Nested Class Summary
(package private)  class ITTPScan.TokenException
          This class that extends the class ittpException send an exception when it is invoked.
(package private)  class TokenStream.ParseException
          This class that extends the class ittpException send an exception when it is invoked.
 
Field Summary
(package private) static int COLON
           
(package private) static int COMA
           
(package private) static int CONNECTION
           
(package private) static int DATE
           
(package private) static int DOUBLESLASH
           
(package private) static int EOF
          Declaration of the several TokenStream used in the program
(package private) static int GET
           
(package private) static int HEAD
           
(package private) static int HOST
           
(package private) static int IF_MODIFIED_SINCE
           
(package private) static int ITTP
           
(package private) static int MINUS
           
(package private) static int NL
           
(package private) static int NUMBER
           
 double nval
           
(package private) static int OPTIONS
           
(package private) static int RANGE
           
(package private) static int SLASH
           
(package private) static int SP
           
 java.lang.String sval
           
 int tok
           
(package private) static int TRACE
           
(package private) static int WORD
           
 
Constructor Summary
ITTPScan(java.io.BufferedReader stream)
          Creates a new instance of Parser
 
Method Summary
 void filterString()
          Method allowing to filter the different characters of a string.
 int next()
          This method analyse and identify the headers contained in the request.
 java.lang.String next(int num)
          This method determine the different parameters of the request that are separated by a syntaxic character.
 ittpException ParseException(java.lang.String msg)
           
 void setup()
           
 java.lang.String toString()
          Convert to a string the headers identified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EOF

static final int EOF
Declaration of the several TokenStream used in the program

See Also:
Constant Field Values

NL

static final int NL
See Also:
Constant Field Values

SP

static final int SP
See Also:
Constant Field Values

NUMBER

static final int NUMBER
See Also:
Constant Field Values

SLASH

static final int SLASH
See Also:
Constant Field Values

DOUBLESLASH

static final int DOUBLESLASH
See Also:
Constant Field Values

COLON

static final int COLON
See Also:
Constant Field Values

COMA

static final int COMA
See Also:
Constant Field Values

MINUS

static final int MINUS
See Also:
Constant Field Values

WORD

static final int WORD
See Also:
Constant Field Values

GET

static final int GET
See Also:
Constant Field Values

HEAD

static final int HEAD
See Also:
Constant Field Values

OPTIONS

static final int OPTIONS
See Also:
Constant Field Values

TRACE

static final int TRACE
See Also:
Constant Field Values

ITTP

static final int ITTP
See Also:
Constant Field Values

CONNECTION

static final int CONNECTION
See Also:
Constant Field Values

DATE

static final int DATE
See Also:
Constant Field Values

HOST

static final int HOST
See Also:
Constant Field Values

IF_MODIFIED_SINCE

static final int IF_MODIFIED_SINCE
See Also:
Constant Field Values

RANGE

static final int RANGE
See Also:
Constant Field Values

tok

public int tok

sval

public java.lang.String sval

nval

public double nval
Constructor Detail

ITTPScan

public ITTPScan(java.io.BufferedReader stream)
Creates a new instance of Parser

Method Detail

setup

public void setup()
Specified by:
setup in class TokenStream

filterString

public void filterString()
Method allowing to filter the different characters of a string.

Specified by:
filterString in class TokenStream

next

public int next()
This method analyse and identify the headers contained in the request.

Specified by:
next in class TokenStream
Returns:
the number associate to the headers.

next

public java.lang.String next(int num)
This method determine the different parameters of the request that are separated by a syntaxic character.

Specified by:
next in class TokenStream
Parameters:
num - int containing the number of token.
Returns:
a string containing the next token of the request.

toString

public java.lang.String toString()
Convert to a string the headers identified.

Returns:
the headers converted in a string.

ParseException

public ittpException ParseException(java.lang.String msg)
Parameters:
msg - String containing the error message.
Returns:
ParceException containing the message msg.