Пример #1
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);
    }
  }