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

ContactParser

public class ContactParser extends AddressParametersParser
A parser for The SIP contact header.
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
Constructors Summary
ContactParser()
Default constructor.

public ContactParser(String contact)
Constructor with initial contact string.

param
contact initial contact field to be processed.

        super(contact);
    
protected ContactParser(Lexer lexer)
Constructor with initial lexer engine.

param
lexer initial lexer engine

        super(lexer);
        this.lexer = lexer;
    
Methods Summary
public Headerparse()
Invokes the parser for the contact header field.

return
theparsed contact header

        // past the header name and the colon.
        headerName(TokenTypes.CONTACT);
        ContactList retval = new ContactList();
        while (true) {
            ContactHeader contact = new ContactHeader();
            if (lexer.lookAhead(0) == '*") {
                this.lexer.match('*");
                contact.setWildCardFlag(true);
            } else super.parse(contact);
            retval.add(contact);
            this.lexer.SPorHT();
            if (lexer.lookAhead(0) == ',") {
                this.lexer.match(',");
                this.lexer.SPorHT();
            } else if (lexer.lookAhead(0) == '\n") break;
            else throw createParseException("unexpected char");
        }
        return retval;