/** * Create a new StatusLine from a String. */ public SipStatusLine createStatusLine(String statusLine) throws ParseException { StatusLineParser statusLineParser = new StatusLineParser(statusLine); return (SipStatusLine) statusLineParser.parse(); }
public StatusLine parse() throws ParseException { try { if (debug) dbg_enter("parse"); StatusLine retval = new StatusLine(); String version = this.sipVersion(); retval.setSipVersion(version); lexer.SPorHT(); int scode = statusCode(); retval.setStatusCode(scode); lexer.SPorHT(); String rp = reasonPhrase(); retval.setReasonPhrase(rp); lexer.SPorHT(); return retval; } finally { if (debug) dbg_leave("parse"); } }
protected int statusCode() throws ParseException { String scode = this.lexer.number(); if (debug) dbg_enter("statusCode"); try { int retval = Integer.parseInt(scode); return retval; } catch (NumberFormatException ex) { throw new ParseException( lexer.getBuffer() + ":" + ex.getMessage(), lexer.getPtr()); } finally { if (debug) dbg_leave("statusCode"); } }
/** * Parse the SIP Response message status line * * @param statusLine * a String containing the Status line to be parsed. * @return StatusLine class corresponding to message * @exception ParseException * if there was an error parsing * @see StatusLine */ public StatusLine parseSIPStatusLine(String statusLine) throws ParseException { statusLine += "\n"; return new StatusLineParser(statusLine).parse(); }
message = new SIPResponse(); try { StatusLine sl = new StatusLineParser(firstLine + "\n").parse(); ((SIPResponse) message).setStatusLine(sl); } catch (ParseException ex) {
StatusLine sl = new StatusLineParser(firstLine + "\n").parse(); ((SIPResponse) message).setStatusLine(sl); } catch (ParseException ex) {