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 forAddress
and its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
AT
private static java.util.BitSet
AT_AND_CLOSING_BRACKET
private static int
CLOSING_BRACKET
private static java.util.BitSet
CLOSING_BRACKET_ONLY
private static int
COLON
private static java.util.BitSet
COLON_ONLY
private static int
COMMA
private static java.util.BitSet
COMMA_ONLY
static LenientAddressParser
DEFAULT
private DecodeMonitor
monitor
private static int
OPENING_BRACKET
private RawFieldParser
parser
private static int
SEMICOLON
private static java.util.BitSet
SEMICOLON_ONLY
-
Constructor Summary
Constructors Modifier Constructor Description protected
LenientAddressParser(DecodeMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Mailbox
createMailbox(java.lang.String localPart)
private Mailbox
createMailbox(java.lang.String name, DomainList route, java.lang.String localPart, java.lang.String domain)
Address
parseAddress(java.lang.CharSequence text)
Parses the specified raw string into an address.Address
parseAddress(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
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(ByteSequence buf, ParserCursor cursor)
(package private) java.lang.String
parseDomain(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
Group
parseGroup(java.lang.CharSequence text)
Parses the specified raw string into a group address.Group
parseGroup(ByteSequence buf, ParserCursor cursor)
Mailbox
parseMailbox(java.lang.CharSequence text)
Parses the specified raw string into a mailbox address.Mailbox
parseMailbox(ByteSequence buf, ParserCursor cursor, java.util.BitSet delimiters)
(package private) Mailbox
parseMailboxAddress(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) DomainList
parseRoute(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:AddressParser
Parses the specified raw string into a mailbox address.- Specified by:
parseMailbox
in interfaceAddressParser
- Parameters:
text
- string to parse.- Returns:
- a
Mailbox
object 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:AddressParser
Parses the specified raw string into a group address.- Specified by:
parseGroup
in interfaceAddressParser
- Parameters:
text
- string to parse.- Returns:
- a
Group
object 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:AddressParser
Parses the specified raw string into an address.- Specified by:
parseAddress
in interfaceAddressParser
- Parameters:
text
- string to parse.- Returns:
- an
Address
object for the specified string.
-
parseAddressList
public AddressList parseAddressList(ByteSequence buf, ParserCursor cursor)
-
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 interfaceAddressParser
- Parameters:
text
- string to parse.
-
-