/** * Parse an address (nameaddr or address spec) and return and address * structure. * * @param address * is a String containing the address to be parsed. * @return a parsed address structure. * @since v1.0 * @exception ParseException * when the address is badly formatted. */ public AddressImpl parseAddress(String address) throws ParseException { AddressParser addressParser = new AddressParser(address); return addressParser.address(true); }
public AddressImpl address( boolean inclParams ) throws ParseException { if (debug) dbg_enter("address"); AddressImpl retval = null; try { break; else if (la == '\0') throw createParseException("unexpected EOL"); else k++; retval = nameAddr(); } else if (la == ':' || la == '/') { retval = new AddressImpl(); retval.setURI(uri); } else { throw createParseException("Bad address spec"); dbg_leave("address");
public javax.sip.address.Address getRemoteTarget() { // jeand : we save the address in a string form and reparse it, help GC // for dialogs updated not too often if (remoteTarget == null && remoteTargetStringified != null) { try { this.remoteTarget = (Address) new AddressParser( remoteTargetStringified).address(true); } catch (ParseException e) { logger.logError( "error reparsing the remoteTarget", e); } } return this.remoteTarget; }
public javax.sip.address.Address getLocalParty() { // jeand : we save the address in a string form and reparse it, help GC // for dialogs updated not too often if (localParty == null && localPartyStringified != null) { try { this.localParty = (Address) new AddressParser( localPartyStringified).address(true); } catch (ParseException e) { logger.logError( "error reparsing the localParty", e); } } return this.localParty; }
protected void parse(AddressHeaderIms addressHeader) throws ParseException { dbg_enter("AddressHeaderParser.parse"); try { AddressParser addressParser = new AddressParser(this.getLexer()); AddressImpl addr = addressParser.address(true); addressHeader.setAddress(addr); } catch (ParseException ex) { throw ex; } finally { dbg_leave("AddressParametersParser.parse"); } }
/** * Returns the Address identifying the remote party. This is the value of * the To header of locally initiated requests in this dialogue when acting * as an User Agent Client. * <p> * This is the value of the From header of recieved responses in this * dialogue when acting as an User Agent Server. * * @return the address object of the remote party. */ public javax.sip.address.Address getRemoteParty() { // jeand : we save the address in a string form and reparse it, help GC // for dialogs updated not too often if (remoteParty == null && remotePartyStringified != null) { try { this.remoteParty = (Address) new AddressParser( remotePartyStringified).address(true); } catch (ParseException e) { logger.logError( "error reparsing the remoteParty", e); } } if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug( "gettingRemoteParty " + this.remoteParty); } return this.remoteParty; }
protected void parse(AddressParametersHeader addressParametersHeader) throws ParseException { dbg_enter("AddressParametersParser.parse"); try { AddressParser addressParser = new AddressParser(this.getLexer()); AddressImpl addr = addressParser.address(false); addressParametersHeader.setAddress(addr); lexer.SPorHT(); char la = this.lexer.lookAhead(0); if ( this.lexer.hasMoreChars() && la != '\0' && la != '\n' && this.lexer.startsId()) { super.parseNameValueList(addressParametersHeader); } else super.parse(addressParametersHeader); } catch (ParseException ex) { throw ex; } finally { dbg_leave("AddressParametersParser.parse"); } } }