Class UrlScanner

  • All Implemented Interfaces:
    Scanner

    public class UrlScanner
    extends Object
    implements Scanner
    Scan for URLs starting from the trigger character ":", requires "://".

    Based on RFC 3986.

    • Constructor Detail

      • UrlScanner

        public UrlScanner()
    • Method Detail

      • scan

        public LinkSpan scan​(CharSequence input,
                             int triggerIndex,
                             int rewindIndex)
        Specified by:
        scan in interface Scanner
        Parameters:
        input - input text
        triggerIndex - the index at which the trigger character for this scanner was
        rewindIndex - 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