Package de.uplanet.util
Class InternetMailAddressParser
java.lang.Object
de.uplanet.util.InternetMailAddressParser
A parser that extracts internet mail addresses from arbitrary text.
The supported address syntax is a subset of the address syntax defined in RFC 5322 and optionally RFC 6532.
Restricted RFC 5322 address syntax recognized by this parser: addr-spec = local-part "@" domain local-part = dot-atom domain = dot-atom dot-atom-text = 1*atext *("." 1*atext) dot-atom = [CFWS] dot-atom-text [CFWS] atext = ALPHA / DIGIT / ; Printable US-ASCII "!" / "#" / ; characters not including "$" / "%" / ; specials. Used for atoms. "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"Under the rules of RFC 6532 the following extended production rules apply:
atext =/ UTF8-non-ascii UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4 UTF8-2 = <Defined in Section 4 of RFC3629> UTF8-3 = <Defined in Section 4 of RFC3629> UTF8-4 = <Defined in Section 4 of RFC3629>
-
Constructor Summary
ConstructorDescriptionCreate a mail address parser that supports internationalized email addresses and a maximum address length of 320 characters.InternetMailAddressParser
(boolean p_bInternationalized, int p_iMaxAddressLength) Create a mail address parser.InternetMailAddressParser
(int p_iMaxAddressLength) Create a mail address parser that supports internationalized email addresses. -
Method Summary
Modifier and TypeMethodDescriptionvoid
finish
(char[] p_buf) void
finish
(char[] p_buf, int p_iStart, int p_iLen) void
finish
(CharSequence p_chseq) void
finish
(CharSequence p_chseq, int p_iStart, int p_iLen) boolean
void
reset()
void
update
(char[] p_buf) void
update
(char[] p_buf, int p_iStart, int p_iLen) void
update
(CharSequence p_chseq) void
update
(CharSequence p_chseq, int p_iStart, int p_iLen)
-
Constructor Details
-
InternetMailAddressParser
public InternetMailAddressParser()Create a mail address parser that supports internationalized email addresses and a maximum address length of 320 characters. -
InternetMailAddressParser
public InternetMailAddressParser(int p_iMaxAddressLength) Create a mail address parser that supports internationalized email addresses.- Parameters:
p_iMaxAddressLength
- The maximum address length in characters.
-
InternetMailAddressParser
public InternetMailAddressParser(boolean p_bInternationalized, int p_iMaxAddressLength) Create a mail address parser.- Parameters:
p_bInternationalized
-true
if internationalized email addresses should be supported, orfalse
otherwise.p_iMaxAddressLength
- The maximum address length in characters.
-
-
Method Details
-
hasAddresses
public boolean hasAddresses() -
getAddresses
-
reset
public void reset() -
update
-
update
-
update
public void update(char[] p_buf) -
update
public void update(char[] p_buf, int p_iStart, int p_iLen) -
finish
-
finish
-
finish
public void finish(char[] p_buf) -
finish
public void finish(char[] p_buf, int p_iStart, int p_iLen)
-