Class LenientAddressParser
- java.lang.Object
-
- org.apache.james.mime4j.field.address.LenientAddressParser
-
- All Implemented Interfaces:
AddressParser
public class LenientAddressParser extends java.lang.Object implements AddressParser
Lenient (tolerant to non-critical format violations) builder forAddressand its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private static intATprivate static java.util.BitSetAT_AND_CLOSING_BRACKETprivate static intCLOSING_BRACKETprivate static java.util.BitSetCLOSING_BRACKET_ONLYprivate static intCOLONprivate static java.util.BitSetCOLON_ONLYprivate static intCOMMAprivate static java.util.BitSetCOMMA_ONLYstatic LenientAddressParserDEFAULTprivate DecodeMonitormonitorprivate static intOPENING_BRACKETprivate RawFieldParserparserprivate static intSEMICOLONprivate static java.util.BitSetSEMICOLON_ONLY
-
Constructor Summary
Constructors Modifier Constructor Description protectedLenientAddressParser(DecodeMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private MailboxcreateMailbox(java.lang.String localPart)private MailboxcreateMailbox(java.lang.String name, DomainList route, java.lang.String localPart, java.lang.String domain)AddressparseAddress(java.lang.CharSequence text)Parses the specified raw string into an address.AddressparseAddress(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)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(ByteSequence buf, ParserCursor cursor)(package private) java.lang.StringparseDomain(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)GroupparseGroup(java.lang.CharSequence text)Parses the specified raw string into a group address.GroupparseGroup(ByteSequence buf, ParserCursor cursor)MailboxparseMailbox(java.lang.CharSequence text)Parses the specified raw string into a mailbox address.MailboxparseMailbox(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)(package private) MailboxparseMailboxAddress(java.lang.String openingText, ByteSequence buf, ParserCursor cursor)(package private) java.util.List<Mailbox>parseMailboxes(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)(package private) DomainListparseRoute(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
-
-
Field Detail
-
AT
private static final int AT
- See Also:
- Constant Field Values
-
OPENING_BRACKET
private static final int OPENING_BRACKET
- See Also:
- Constant Field Values
-
CLOSING_BRACKET
private static final int CLOSING_BRACKET
- See Also:
- Constant Field Values
-
COMMA
private static final int COMMA
- See Also:
- Constant Field Values
-
COLON
private static final int COLON
- See Also:
- Constant Field Values
-
SEMICOLON
private static final int SEMICOLON
- See Also:
- Constant Field Values
-
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
-
DEFAULT
public static final LenientAddressParser DEFAULT
-
monitor
private final DecodeMonitor monitor
-
parser
private final RawFieldParser parser
-
-
Constructor Detail
-
LenientAddressParser
protected LenientAddressParser(DecodeMonitor monitor)
-
-
Method Detail
-
parseDomain
java.lang.String parseDomain(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
parseRoute
DomainList parseRoute(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
createMailbox
private Mailbox createMailbox(java.lang.String name, DomainList route, java.lang.String localPart, java.lang.String domain)
-
parseMailboxAddress
Mailbox parseMailboxAddress(java.lang.String openingText, ByteSequence buf, ParserCursor cursor)
-
createMailbox
private Mailbox createMailbox(java.lang.String localPart)
-
parseMailbox
public Mailbox parseMailbox(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
parseMailbox
public Mailbox parseMailbox(java.lang.CharSequence text)
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.
-
parseMailboxes
java.util.List<Mailbox> parseMailboxes(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
parseGroup
public Group parseGroup(ByteSequence buf, ParserCursor cursor)
-
parseGroup
public Group parseGroup(java.lang.CharSequence text)
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.
-
parseAddress
public Address parseAddress(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
-
parseAddress
public Address parseAddress(java.lang.CharSequence text)
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.
-
parseAddressList
public AddressList parseAddressList(ByteSequence buf, ParserCursor cursor)
-
parseAddressList
public AddressList parseAddressList(java.lang.CharSequence text)
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.
-
-