java.lang.Object
org.nibor.autolink.internal.EmailScanner
- All Implemented Interfaces:
Scanner
Scan for email address starting from the trigger character "@".
Based on RFC 6531, but also scans invalid IDN. Doesn't match IP address in domain part or quoting in local part.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intfindFirst(CharSequence input, int beginIndex, int rewindIndex) private intfindLast(CharSequence input, int beginIndex) private booleanlocalAtomAllowed(char c) scan(CharSequence input, int triggerIndex, int rewindIndex) private booleansubDomainAllowed(char c)
-
Field Details
-
domainMustHaveDot
private final boolean domainMustHaveDot
-
-
Constructor Details
-
EmailScanner
public EmailScanner(boolean domainMustHaveDot)
-
-
Method Details
-
scan
- Specified by:
scanin interfaceScanner- Parameters:
input- input texttriggerIndex- the index at which the trigger character for this scanner wasrewindIndex- the index that can maximally be rewound to (either the very first character of the input or the character after the last matched link) need to be set to be set here- Returns:
- the matched link, or
nullif no link matched
-
findFirst
-
findLast
-
localAtomAllowed
private boolean localAtomAllowed(char c) -
subDomainAllowed
private boolean subDomainAllowed(char c)
-