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

MaxForwardsParser

public class MaxForwardsParser extends HeaderParser
Parser for Max Forwards Header.
version
JAIN-SIP-1.1 This code is in the public domain.
version
1.0

Fields Summary
Constructors Summary
MaxForwardsParser()
Default constructor.

public MaxForwardsParser(String contentLength)
Constructor with initial content length header string.

param
contentLength initial contentlength header

        super(contentLength);
    
protected MaxForwardsParser(Lexer lexer)
Constructor with initial lexer engine.

param
lexer initial lexer engine

        super(lexer);
    
Methods Summary
public Headerparse()
Invokes parser for maximum forwards header field.

return
the parsed maximum forwards header
exception
ParseException if a parsing error occurs

        if (debug) dbg_enter("MaxForwardsParser.enter");
        try {
            MaxForwardsHeader maxForwards = new MaxForwardsHeader();
            headerName(TokenTypes.MAX_FORWARDS);
            String number = this.lexer.number();
            maxForwards.setMaxForwards(Integer.parseInt(number));
            this.lexer.SPorHT();
            this.lexer.match('\n");
            return maxForwards;
        } catch (IllegalArgumentException ex) {
            throw createParseException(ex.getMessage());
        } finally {
            if (debug) dbg_leave("MaxForwardsParser.leave");
        }