| java.lang.Object com.sun.tck.wma.mms.MMSAddress
MMSAddress | public class MMSAddress (Code) | | MMS address parsing and validation.
MMS address is validated according to Table D-2 in WMA2.0 specification.
In addition address is parsed into the fields of MMSAddress
object.
|
Field Summary | |
final public static int | APP_ID Type corresponding to the application id address. | final public static int | EMAIL Type corresponding to the e-mail address. | final public static int | GLOBAL_PHONE_NUMBER Type corresponding to global phone number address. | final public static int | INVALID_ADDRESS Type corresponding to invalid address. | final public static int | IPV4 Type corresponding to the ipv4 address. | final public static int | IPV6 Type corresponding to the ipv6 address. | final public static int | SHORTCODE Type corresponding to the shortcode address. | public String | address Field that holds address part of the mms address
(without "mms://" and ":" separator before app id). | public String | appId Field that holds application id part of the mms address
which appears after "mms://:" or
after phone number, ipv4, or ipv6 followed by ":" . | public int | type Type of this MMSAddress instance,
INVALID_ADDRESS when uninitialized . |
Constructor Summary | |
| MMSAddress() MMSAddress constructor to create uninitialized instance. | | MMSAddress(String address, String appId, int type) MMSAddress constructor to create initialized instance. |
Method Summary | |
void | clear() Clears MMSAddress fields. | String | getMMSAddressString() Creates a valid mms address corresponding to the values
in this MMSAddress object. | public static MMSAddress | getParsedMMSAddress(String addressStr) Determines whether a string represents a valid mms address
as specified in WMA 2.0 specification and parses the
incoming string into address and application id strings.
Parameters: addressStr - The string to check. | public static MMSAddress | getParsedMMSAddress(String addressStr, MMSAddress mmsAddress) Determines whether a string represents a valid mms address
as specified in WMA 2.0 specification and parses the
incoming string into address and application id strings.
Parameters: addressStr - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields will be filled with parsed address andapplication id, and correspoinding type (EMAIL, GLOBAL_PHONE_NUMBER,IPV4, IPV6, SHORTCODE, APP_ID). | static boolean | parseApplicationId(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid application ID
starting from an index.If the address string is a valid
application id representation it is parsed into the fields of
MMSAddress object (application id and null for the
address).
Application ID syntax is specified in WMA 2.0 spec as :
":"[*(1*(alpha | digit | "." | "_") ".")]1*(alpha | digit | "." | "_").
The number of characters in application ID must not exceed 32.
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address (null in this case) andapplication id, its type is set to APP_ID. Parameters: i - The index of the string at which to start the check. | static boolean | parseEmail(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid e-mail address
starting from an index. | static boolean | parseIpv4(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid ipv4 address
starting from an index. | static boolean | parseIpv6(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid ipv6 address
starting from an index. | static boolean | parsePhoneNumber(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid phone number
starting from an index. | static boolean | parseShortCode(String s, int i, MMSAddress mmsAddress) Determines whether a string represents a valid shortcode
starting from an index. | void | set(String address, String appId, int type) Sets MMSAddress fields to the passed in values. | void | setAppid(String appId) Sets MMSAddress application id field to
the passed in value. |
APP_ID | final public static int APP_ID(Code) | | Type corresponding to the application id address.
|
EMAIL | final public static int EMAIL(Code) | | Type corresponding to the e-mail address.
|
GLOBAL_PHONE_NUMBER | final public static int GLOBAL_PHONE_NUMBER(Code) | | Type corresponding to global phone number address.
|
INVALID_ADDRESS | final public static int INVALID_ADDRESS(Code) | | Type corresponding to invalid address.
|
IPV4 | final public static int IPV4(Code) | | Type corresponding to the ipv4 address.
|
IPV6 | final public static int IPV6(Code) | | Type corresponding to the ipv6 address.
|
SHORTCODE | final public static int SHORTCODE(Code) | | Type corresponding to the shortcode address.
|
address | public String address(Code) | | Field that holds address part of the mms address
(without "mms://" and ":" separator before app id).
|
appId | public String appId(Code) | | Field that holds application id part of the mms address
which appears after "mms://:" or
after phone number, ipv4, or ipv6 followed by ":" .
|
type | public int type(Code) | | Type of this MMSAddress instance,
INVALID_ADDRESS when uninitialized .
|
MMSAddress | MMSAddress()(Code) | | MMSAddress constructor to create uninitialized instance.
|
MMSAddress | MMSAddress(String address, String appId, int type)(Code) | | MMSAddress constructor to create initialized instance.
Parameters: address - The address part of the mms address Parameters: appId - The application id part of the mms address Parameters: type - The type of this mms addreess(EMAIL, GLOBAL_PHONE_NUMBER, IPV4, IPV6, SHORTCODE, APP_ID) |
clear | void clear()(Code) | | Clears MMSAddress fields.
Type is set to INVALID_ADDRESS while
address and appId are set to null.
|
getMMSAddressString | String getMMSAddressString()(Code) | | Creates a valid mms address corresponding to the values
in this MMSAddress object.
If the object is not intialized null is returned.
mms address corresponding to this MMSAddress object. |
getParsedMMSAddress | public static MMSAddress getParsedMMSAddress(String addressStr)(Code) | | Determines whether a string represents a valid mms address
as specified in WMA 2.0 specification and parses the
incoming string into address and application id strings.
Parameters: addressStr - The string to check. newly created MMSAddress object if addressStr is a valid mms address; null otherwise |
getParsedMMSAddress | public static MMSAddress getParsedMMSAddress(String addressStr, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid mms address
as specified in WMA 2.0 specification and parses the
incoming string into address and application id strings.
Parameters: addressStr - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields will be filled with parsed address andapplication id, and correspoinding type (EMAIL, GLOBAL_PHONE_NUMBER,IPV4, IPV6, SHORTCODE, APP_ID). MMSAddress object if addressStr is a valid mms address; null otherwise |
parseApplicationId | static boolean parseApplicationId(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid application ID
starting from an index.If the address string is a valid
application id representation it is parsed into the fields of
MMSAddress object (application id and null for the
address).
Application ID syntax is specified in WMA 2.0 spec as :
":"[*(1*(alpha | digit | "." | "_") ".")]1*(alpha | digit | "." | "_").
The number of characters in application ID must not exceed 32.
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address (null in this case) andapplication id, its type is set to APP_ID. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() true if s represents a valid application ID starting from index i ; false otherwise and if index i isinvalide value |
parseEmail | static boolean parseEmail(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid e-mail address
starting from an index. If the address string is a valid
e-mail address representation it is parsed into the fields of
MMSAddress object (address and null for appId).
E-mail syntax is specified in WMA 2.0 spec.
Parameters: s - The string to check. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address andapplication id (null in this case), its type is set to EMAIL. true if s represents a valid e-mail address starting from index i ; false otherwise and if index i isinvalide value |
parseIpv4 | static boolean parseIpv4(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid ipv4 address
starting from an index. If the address string is a valid
ipv4 representation it is parsed into the fields of
MMSAddress object (address and application id).
ipv4 syntax is specified in WMA 2.0 spec as :
1*3digit "." 1*3digit "." 1*3digit "." 1*3digit [applicationId]
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address andapplication id (which can be null), its type is set to IPV4. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() true if s represents a valid ipv4 address starting from index i ; false otherwise and if index i isinvalide value |
parseIpv6 | static boolean parseIpv6(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid ipv6 address
starting from an index. If the address string is a valid
ipv6 representation it is parsed into the fields of
MMSAddress object (address and application id).
ipv6 syntax is specified in WMA 2.0 spec as :
ipv6-atom ":" ipv6-atom ":" ipv6-atom ":" ipv6-atom ":"
ipv6-atom ":" ipv6-atom ":" ipv6-atom ":" ipv6-atom [appId]
where ipv6-atom is 1*4(digit | hex-alpha).
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address andapplication id (which can be null), its type is set to IPV6. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() true if s represents a valid ipv6 address starting from index i ; false otherwise and if index i isinvalide value |
parsePhoneNumber | static boolean parsePhoneNumber(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid phone number
starting from an index. If the address string is a valid
phone number representation it is parsed into the fields of
MMSAddress object (address and application id).
General phone number syntax is specified in WMA 2.0 spec as :
("+" 1*digit | 1*digit) [applicationId]
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address andapplication id (which can be null), its type is set to GLOBAL_PHONE_NUMBER. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() true if s represents a valid phone number starting from index i ; false otherwise and if index i isinvalide value |
parseShortCode | static boolean parseShortCode(String s, int i, MMSAddress mmsAddress)(Code) | | Determines whether a string represents a valid shortcode
starting from an index. If the address string is a valid
shortcode representation it is parsed into the fields of
MMSAddress object (address and null for appId).
Shortcode syntax is specified in WMA 2.0 spec as :
(digit | alpha)
Parameters: s - The string to check. Parameters: mmsAddress - The return MMSAddress object whichfields are filled with parsed address and application id (null inthis case), its type is set to SHORTCODE. Parameters: i - The index of the string at which to start the check. 0 <= i <= s.length() true if s represents a valid shortcode starting from index i ; false otherwise and if index i isinvalide value |
set | void set(String address, String appId, int type)(Code) | | Sets MMSAddress fields to the passed in values.
Parameters: address - The address part of the mms address Parameters: appId - The application id part of the mms address Parameters: type - The type of this mms addreess(EMAIL, GLOBAL_PHONE_NUMBER, IPV4, IPV6, SHORTCODE, APP_ID) |
setAppid | void setAppid(String appId)(Code) | | Sets MMSAddress application id field to
the passed in value.
Parameters: appId - The application id part of the mms address |
|
|