Class DefaultAddressParser
- java.lang.Object
-
- org.apache.james.mime4j.field.address.DefaultAddressParser
-
- All Implemented Interfaces:
AddressParser
public class DefaultAddressParser extends java.lang.Object implements AddressParser
Default (strict) builder forAddressand its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultAddressParserDEFAULT
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAddressParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressparseAddress(java.lang.CharSequence text)Parses the specified raw string into an address.AddressparseAddress(java.lang.CharSequence text, DecodeMonitor monitor)Parses the specified raw string into an address.AddressListparseAddressList(java.lang.CharSequence text)Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header.AddressListparseAddressList(java.lang.CharSequence text, DecodeMonitor monitor)Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header.GroupparseGroup(java.lang.CharSequence text)Parses the specified raw string into a group address.GroupparseGroup(java.lang.CharSequence text, DecodeMonitor monitor)Parses the specified raw string into a group address.MailboxparseMailbox(java.lang.CharSequence text)Parses the specified raw string into a mailbox address.MailboxparseMailbox(java.lang.CharSequence text, DecodeMonitor monitor)Parses the specified raw string into a mailbox address.
-
-
-
Field Detail
-
DEFAULT
public static final DefaultAddressParser DEFAULT
-
-
Method Detail
-
parseAddress
public Address parseAddress(java.lang.CharSequence text, DecodeMonitor monitor) throws ParseException
Parses the specified raw string into an address.- Parameters:
text- string to parse.monitor- the DecodeMonitor to be used while parsing/decoding- Returns:
- an
Addressobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single address.
-
parseAddress
public Address parseAddress(java.lang.CharSequence text) throws ParseException
Description copied from interface:AddressParserParses the specified raw string into an address.- Specified by:
parseAddressin interfaceAddressParser- Parameters:
text- string to parse.- Returns:
- an
Addressobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single address.
-
parseAddressList
public AddressList parseAddressList(java.lang.CharSequence text, DecodeMonitor monitor) throws ParseException
Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header. The string MUST be unfolded already.- Parameters:
monitor- the DecodeMonitor to be used while parsing/decoding- Throws:
ParseException
-
parseAddressList
public AddressList parseAddressList(java.lang.CharSequence text) throws ParseException
Description copied from interface:AddressParserParse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header. The string MUST be unfolded already.- Specified by:
parseAddressListin interfaceAddressParser- Parameters:
text- string to parse.- Throws:
ParseException
-
parseMailbox
public Mailbox parseMailbox(java.lang.CharSequence text, DecodeMonitor monitor) throws ParseException
Parses the specified raw string into a mailbox address.- Parameters:
text- string to parse.monitor- the DecodeMonitor to be used while parsing/decoding.- Returns:
- a
Mailboxobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single mailbox address.
-
parseMailbox
public Mailbox parseMailbox(java.lang.CharSequence text) throws ParseException
Description copied from interface:AddressParserParses the specified raw string into a mailbox address.- Specified by:
parseMailboxin interfaceAddressParser- Parameters:
text- string to parse.- Returns:
- a
Mailboxobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single mailbox address.
-
parseGroup
public Group parseGroup(java.lang.CharSequence text, DecodeMonitor monitor) throws ParseException
Parses the specified raw string into a group address.- Parameters:
text- string to parse.- Returns:
- a
Groupobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single group address.
-
parseGroup
public Group parseGroup(java.lang.CharSequence text) throws ParseException
Description copied from interface:AddressParserParses the specified raw string into a group address.- Specified by:
parseGroupin interfaceAddressParser- Parameters:
text- string to parse.- Returns:
- a
Groupobject for the specified string. - Throws:
ParseException- if the raw string does not represent a single group address.
-
-