Class DefaultAddressParser

  • All Implemented Interfaces:
    AddressParser

    public class DefaultAddressParser
    extends java.lang.Object
    implements AddressParser
    Default (strict) builder for Address and its subclasses.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DefaultAddressParser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Address parseAddress​(java.lang.CharSequence text)
      Parses the specified raw string into an address.
      Address parseAddress​(java.lang.CharSequence text, DecodeMonitor monitor)
      Parses the specified raw string into an address.
      AddressList parseAddressList​(java.lang.CharSequence text)
      Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header.
      AddressList parseAddressList​(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.
      Group parseGroup​(java.lang.CharSequence text)
      Parses the specified raw string into a group address.
      Group parseGroup​(java.lang.CharSequence text, DecodeMonitor monitor)
      Parses the specified raw string into a group address.
      Mailbox parseMailbox​(java.lang.CharSequence text)
      Parses the specified raw string into a mailbox address.
      Mailbox parseMailbox​(java.lang.CharSequence text, 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
    • Constructor Detail

      • DefaultAddressParser

        protected DefaultAddressParser()
    • 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 Address object 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: AddressParser
        Parses the specified raw string into an address.
        Specified by:
        parseAddress in interface AddressParser
        Parameters:
        text - string to parse.
        Returns:
        an Address object 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: AddressParser
        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.
        Specified by:
        parseAddressList in interface AddressParser
        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 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.CharSequence text)
                             throws ParseException
        Description copied from interface: AddressParser
        Parses the specified raw string into a mailbox address.
        Specified by:
        parseMailbox in interface AddressParser
        Parameters:
        text - string to parse.
        Returns:
        a Mailbox object 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 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.CharSequence text)
                         throws ParseException
        Description copied from interface: AddressParser
        Parses the specified raw string into a group address.
        Specified by:
        parseGroup in interface AddressParser
        Parameters:
        text - string to parse.
        Returns:
        a Group object for the specified string.
        Throws:
        ParseException - if the raw string does not represent a single group address.