java.lang.Object
org.nibor.autolink.internal.WwwScanner
- All Implemented Interfaces:
Scanner
Scan for WWW addresses such as "www.example.org" starting from the trigger character "w".
Requires "www." at the beginning and an additional dot in the domain.
Based on RFC 3986.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
findFirst
(CharSequence input, int beginIndex, int rewindIndex) private static int
findLast
(CharSequence input, int beginIndex) private static boolean
isAllowed
(char c) private static boolean
isWww
(CharSequence input, int triggerIndex) scan
(CharSequence input, int triggerIndex, int rewindIndex)
-
Constructor Details
-
WwwScanner
public WwwScanner()
-
-
Method Details
-
scan
- Specified by:
scan
in 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
null
if no link matched
-
findFirst
-
findLast
-
isAllowed
private static boolean isAllowed(char c) -
isWww
-