|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.mail.Address
public class Address
A class describing the RFC 2822 address specification as per § 3.4
Field Summary | |
---|---|
static int |
BCC
|
static int |
CC
|
static int |
FROM
|
static int |
REPLYTO
|
static int |
TO
|
Constructor Summary | |
---|---|
Address(int type,
java.lang.String address)
Creates a new instance of Address, parsing address |
|
Address(int type,
java.lang.String name,
java.lang.String address)
Creates a new instance of Address |
Method Summary | |
---|---|
java.lang.String |
getEmail()
Returns the email address |
java.lang.String |
getName()
Returns the visible name TODO: or the address if null? |
int |
getType()
Returns the type of address |
java.lang.String |
getVisibleName()
Returns the name or the address if name is empy |
static Address[] |
parse(int type,
java.lang.String addresslist)
Parses an address list and return an array of Address
objects, each representing a recipient. |
void |
setEmail(java.lang.String email)
Set the email address |
void |
setName(java.lang.String name)
Set the visible name |
void |
setType(int type)
Set the type of address |
java.lang.String |
toString()
Returns the string representation of the Address, in RFC2822 format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FROM
public static final int TO
public static final int CC
public static final int BCC
public static final int REPLYTO
Constructor Detail |
---|
public Address(int type, java.lang.String address) throws MailException
address
to
- Throws:
MailException
public Address(int type, java.lang.String name, java.lang.String address) throws MailException
MailException
Method Detail |
---|
public int getType()
public java.lang.String getVisibleName()
public java.lang.String getName()
public java.lang.String getEmail()
public void setType(int type)
public void setName(java.lang.String name)
public void setEmail(java.lang.String email) throws MailException
MailException
public static Address[] parse(int type, java.lang.String addresslist) throws MailException
Address
objects, each representing a recipient.
Use: Address [] list = Address.parse( Address.TO, "John
Doe<john.doe@mail.com>"
addresslist
- the comma separated list of addresses
Address
containing the result, or an
empty array if addresslist is empty
MailException
- if the address is malformed
TODO: Improve the Parser: now a visible name like:
"Mario Rossi, Funambol Inc" breaks it.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |