Class LenientAddressParser

  • All Implemented Interfaces:
    AddressParser

    public class LenientAddressParser
    extends java.lang.Object
    implements AddressParser
    Lenient (tolerant to non-critical format violations) builder for Address and its subclasses.
    • Field Detail

      • AT_AND_CLOSING_BRACKET

        private static final java.util.BitSet AT_AND_CLOSING_BRACKET
      • CLOSING_BRACKET_ONLY

        private static final java.util.BitSet CLOSING_BRACKET_ONLY
      • COMMA_ONLY

        private static final java.util.BitSet COMMA_ONLY
      • COLON_ONLY

        private static final java.util.BitSet COLON_ONLY
      • SEMICOLON_ONLY

        private static final java.util.BitSet SEMICOLON_ONLY
    • Constructor Detail

      • LenientAddressParser

        protected LenientAddressParser​(DecodeMonitor monitor)
    • Method Detail

      • createMailbox

        private Mailbox createMailbox​(java.lang.String name,
                                      DomainList route,
                                      java.lang.String localPart,
                                      java.lang.String domain)
      • createMailbox

        private Mailbox createMailbox​(java.lang.String localPart)
      • parseMailbox

        public Mailbox parseMailbox​(java.lang.CharSequence text)
        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.
      • parseGroup

        public Group parseGroup​(java.lang.CharSequence text)
        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.
      • parseAddress

        public Address parseAddress​(java.lang.CharSequence text)
        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.
      • parseAddressList

        public AddressList parseAddressList​(java.lang.CharSequence text)
        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.