org.apache.james.mime4j.field.address
Class AddressBuilder

java.lang.Object
  extended by org.apache.james.mime4j.field.address.AddressBuilder

public class AddressBuilder
extends java.lang.Object

Default (strict) builder for Address and its subclasses.


Field Summary
static AddressBuilder DEFAULT
           
 
Constructor Summary
protected AddressBuilder()
           
 
Method Summary
 Address parseAddress(java.lang.String rawAddressString)
           
 Address parseAddress(java.lang.String rawAddressString, DecodeMonitor monitor)
          Parses the specified raw string into an address.
 AddressList parseAddressList(java.lang.String rawAddressList)
           
 AddressList parseAddressList(java.lang.String rawAddressList, DecodeMonitor monitor)
          Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header.
 Group parseGroup(java.lang.String rawGroupString)
           
 Group parseGroup(java.lang.String rawGroupString, DecodeMonitor monitor)
          Parses the specified raw string into a group address.
 Mailbox parseMailbox(java.lang.String rawMailboxString)
           
 Mailbox parseMailbox(java.lang.String rawMailboxString, DecodeMonitor monitor)
          Parses the specified raw string into a mailbox address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final AddressBuilder DEFAULT
Constructor Detail

AddressBuilder

protected AddressBuilder()
Method Detail

parseAddress

public Address parseAddress(java.lang.String rawAddressString,
                            DecodeMonitor monitor)
                     throws ParseException
Parses the specified raw string into an address.

Parameters:
rawAddressString - string to parse.
monitor - the DecodeMonitor to be used while parsing/decoding
Returns:
an Address object for the specified string.
Throws:
ParseException - if the raw string does not represent a single address.

parseAddress

public Address parseAddress(java.lang.String rawAddressString)
                     throws ParseException
Throws:
ParseException

parseAddressList

public AddressList parseAddressList(java.lang.String rawAddressList,
                                    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.String rawAddressList)
                             throws ParseException
Throws:
ParseException

parseMailbox

public Mailbox parseMailbox(java.lang.String rawMailboxString,
                            DecodeMonitor monitor)
                     throws ParseException
Parses the specified raw string into a mailbox address.

Parameters:
rawMailboxString - string to parse.
monitor - the DecodeMonitor to be used while parsing/decoding.
Returns:
a Mailbox object for the specified string.
Throws:
ParseException - if the raw string does not represent a single mailbox address.

parseMailbox

public Mailbox parseMailbox(java.lang.String rawMailboxString)
                     throws ParseException
Throws:
ParseException

parseGroup

public Group parseGroup(java.lang.String rawGroupString,
                        DecodeMonitor monitor)
                 throws ParseException
Parses the specified raw string into a group address.

Parameters:
rawGroupString - string to parse.
Returns:
a Group object for the specified string.
Throws:
ParseException - if the raw string does not represent a single group address.

parseGroup

public Group parseGroup(java.lang.String rawGroupString)
                 throws ParseException
Throws:
ParseException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.