FileDocCategorySizeDatePackage
CSeqParser.javaAPI DocphoneME MR2 API (J2ME)2598Wed May 02 18:00:42 BST 2007gov.nist.siplite.parser

CSeqParser

public class CSeqParser extends HeaderParser
Parser for CSeq headers.
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
Constructors Summary
CSeqParser()
Default constructor.

public CSeqParser(String cseq)
Constructore with initial c-sequence header.

param
cseq initial header value

        super(cseq);
    
protected CSeqParser(Lexer lexer)
Constructor with initial lexer engine.

param
lexer initial charcater parsing engine

        super(lexer);
    
Methods Summary
public Headerparse()
Invokes the parsing engine.

return
the parsed header

        try {
            CSeqHeader c = new CSeqHeader();
            
            this.lexer.match(TokenTypes.CSEQ);
            this.lexer.SPorHT();
            this.lexer.match(':");
            this.lexer.SPorHT();
            String number = this.lexer.number();
            c.setSequenceNumber(Integer.parseInt(number));
            this.lexer.SPorHT();
            String m = method();
            c.setMethod(m);
            this.lexer.SPorHT();
            this.lexer.match('\n");
            return c;
        } catch (NumberFormatException ex) {
            
            throw createParseException("Number format exception");
        }