示例#1
0
 /**
  * Creates an Address with the new display name and URI attribute values.
  *
  * @param displayName - the new string value of the display name of the address. A <code>null
  *     </code> value does not set the display name.
  * @param uri - the new URI value of the address.
  * @throws ParseException which signals that an error has been reached unexpectedly while parsing
  *     the displayName value.
  */
 public javax.sip.address.Address createAddress(String displayName, javax.sip.address.URI uri) {
   if (uri == null) throw new NullPointerException("null  URI");
   AddressImpl addressImpl = new AddressImpl();
   if (displayName != null) addressImpl.setDisplayName(displayName);
   addressImpl.setURI(uri);
   return addressImpl;
 }
示例#2
0
  /**
   * Creates an Address with the new address string value. The address string is parsed in order to
   * create the new Address instance. Create with a String value of "*" creates a wildcard address.
   * The wildcard can be determined if <code>((SipURI)Address.getURI).getUser() == *;</code>.
   *
   * @param address - the new string value of the address.
   * @throws ParseException which signals that an error has been reached unexpectedly while parsing
   *     the address value.
   */
  public javax.sip.address.Address createAddress(String address) throws java.text.ParseException {
    if (address == null) throw new NullPointerException("null address");

    if (address.equals("*")) {
      AddressImpl addressImpl = new AddressImpl();
      addressImpl.setAddressType(AddressImpl.WILD_CARD);
      SipURI uri = new SipUri();
      uri.setUser("*");
      addressImpl.setURI(uri);
      return addressImpl;
    } else {
      StringMsgParser smp = new StringMsgParser();
      return smp.parseAddress(address);
    }
  }
示例#3
0
 public javax.sip.address.Address createAddress(javax.sip.address.URI uri) {
   if (uri == null) throw new NullPointerException("null address");
   AddressImpl addressImpl = new AddressImpl();
   addressImpl.setURI(uri);
   return addressImpl;
 }