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

RequestLineParser

public class RequestLineParser extends Parser
Parser for the SIP request line.
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
Constructors Summary
public RequestLineParser(String requestLine)
Constructor with initial request line string.

param
requestLine initial request line

        this.lexer = new Lexer("method_keywordLexer", requestLine);
    
public RequestLineParser(Lexer lexer)
Constructor with initial lexer engine.

param
lexer initial lexer engine

        this.lexer = lexer;
        this.lexer.selectLexer("method_keywordLexer");
    
Methods Summary
public RequestLineparse()
Invokes parser for the request line.

return
the parsed request line
exception
ParseException if a parsing error occurs

        if (debug) dbg_enter("parse");
        try {
            RequestLine retval = new RequestLine();
            String m = method();
            lexer.SPorHT();
            retval.setMethod(m);
            this.lexer.selectLexer("sip_urlLexer");
            URLParser urlParser = new URLParser(this.getLexer());
            URI url = urlParser.uriReference();
            lexer.SPorHT();
            retval.setUri(url);
            this.lexer.selectLexer("request_lineLexer");
            String v = sipVersion();
            retval.setSipVersion(v);
            lexer.SPorHT();
            lexer.match('\n");
            return retval;
        } finally {
            if (debug) dbg_leave("parse");
        }