Methods Summary |
---|
protected ParseException | createParseException(java.lang.String exceptionString)Creates a ParseException with the provided message.
return new ParseException
(lexer.getBuffer() + ":" + exceptionString, lexer.getPtr());
|
protected Lexer | getLexer()Gets the current lexer engine.
return (Lexer) this.lexer;
|
protected java.lang.String | method()Parses a method. Consumes if a valid method has been found.
try {
if (debug) dbg_enter("method");
Vector tokens = this.lexer.peekNextToken(1);
Token token = (Token) tokens.elementAt(0);
int tokenType = token.getTokenType();
if (tokenType == INVITE ||
tokenType == ACK ||
tokenType == OPTIONS ||
tokenType == BYE ||
tokenType == REGISTER ||
tokenType == CANCEL ||
tokenType == SUBSCRIBE ||
tokenType == NOTIFY ||
tokenType == ID ||
tokenType == MESSAGE ||
tokenType == INFO ||
tokenType == PUBLISH ||
tokenType == UPDATE ||
tokenType == PRACK ||
tokenType == REFER) {
lexer.consume();
return token.getTokenValue();
} else {
throw createParseException
("Invalid Method");
}
} finally {
if (debug) dbg_leave("method");
}
|
protected java.lang.String | sipVersion()Gets the current SIP version string.
if (debug) dbg_enter("sipVersion");
try {
Token tok = lexer.match(SIP);
if (! tok.getTokenValue().equals("SIP"))
createParseException("Expecting SIP");
lexer.match('/");
tok = lexer.match(ID);
if (! tok.getTokenValue().equals("2.0"))
createParseException("Expecting SIP/2.0");
return "SIP/2.0";
} finally {
if (debug) dbg_leave("sipVersion");
}
|