javax.mail.internet
public class InternetAddress extends Address implements Cloneable
Field Summary | |
---|---|
protected String | address
The address in RFC822 format. |
protected String | encodedPersonal
The personal name in RFC2047 format.
|
protected String | personal
The personal name as a Java String.
|
Constructor Summary | |
---|---|
InternetAddress() | |
InternetAddress(String address) | |
InternetAddress(String address, boolean strict) | |
InternetAddress(String address, String personal) | |
InternetAddress(String address, String personal, String charset) |
Method Summary | |
---|---|
Object | clone()
Clone this object.
|
boolean | equals(Object o)
Compares two addresses for equality.
|
String | getAddress()
Return the address.
|
InternetAddress[] | getGroup(boolean strict)
Return the members of a group address.
|
static InternetAddress | getLocalAddress(Session session)
Return an InternetAddress representing the current user.
|
String | getPersonal()
Return the personal name.
|
String | getType()
Return the type of this address.
|
int | hashCode()
Return the hashCode for this address.
|
boolean | isGroup()
Return true is this address is an RFC822 group address in the format
phrase ":" [#mailbox] ";" .
|
static InternetAddress[] | parse(String addresses)
Parse addresses out of the string with basic checking.
|
static InternetAddress[] | parse(String addresses, boolean strict)
Parse addresses out of the string.
|
static InternetAddress[] | parseHeader(String addresses, boolean strict)
Parse addresses out of the string.
|
void | setAddress(String address)
Set the address.
|
void | setPersonal(String name, String charset)
Set the personal name.
|
void | setPersonal(String name)
Set the personal name.
|
String | toString()
Return a string representation of this address using only US-ASCII characters.
|
static String | toString(Address[] addresses)
Convert the supplied addresses into a single String of comma-separated text as
produced by toString() .
|
static String | toString(Address[] addresses, int used)
Convert the supplies addresses into a String of comma-separated text,
inserting line-breaks between addresses as needed to restrict the line
length to 72 characters. |
String | toUnicodeString()
Return a string representation of this address using Unicode characters.
|
void | validate() |
Returns: a copy of this object as created by Object.clone()
Parameters: o the other object
Returns: true if the addresses are the same
Returns: the address
Parameters: strict whether strict RFC822 checking should be performed
Returns: an array of InternetAddress objects for the group members, or null if this address is not a group
Throws: AddressException if there was a problem parsing the header
Parameters: session used to obtain mail properties
Returns: an InternetAddress for the current user, or null if it cannot be determined
Returns: the personal name
Returns: the type of this address; always "rfc822"
Returns: a hashCode for this address
phrase ":" [#mailbox] ";"
.
We check this by seeing stripping the leading phrase (which, for tolerance,
we consider optional) and then checking if the first and last characters are
':' and ';' respectively.
Returns: true is this address represents a group
Parameters: addresses the addresses to parse
Returns: an array of InternetAddresses parsed from the string
Throws: AddressException if addresses checking fails
Parameters: addresses the addresses to parse strict if true perform detailed checking, if false just perform basic checking
Returns: an array of InternetAddresses parsed from the string
Throws: AddressException if address checking fails
Parameters: addresses the addresses to parse strict if true perform detailed checking, if false perform little checking
Returns: an array of InternetAddresses parsed from the string
Throws: AddressException if address checking fails
Parameters: address the address to set
Parameters: name the new personal name charset the charset to use; see MimeUtilityencodeWord
Throws: UnsupportedEncodingException if the name cannot be encoded
Parameters: name the new personal name
Throws: UnsupportedEncodingException if the name cannot be encoded
Returns: a string representation of this address
toString()
.
No line-break detection is performed.
Parameters: addresses the array of addresses to convert
Returns: a one-line String of comma-separated addresses
Parameters: addresses the array of addresses to convert used the starting column
Returns: a String of comma-separated addresses with optional line breaks
Returns: a string representation of this address