Top Description Constructors Methods
org.nibor.autolink.internal

public Class WwwScanner

extends Object
implements Scanner
Class Inheritance
All Implemented Interfaces
org.nibor.autolink.internal.Scanner
Imports
org.nibor.autolink.LinkSpan, .LinkType

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
findFirst(final CharSequence input, final int beginIndex, final int rewindIndex)

private static int
findLast(final CharSequence input, final int beginIndex)

private static boolean
isAllowed(char c)

private static boolean
isWww(final CharSequence input, final int triggerIndex)

public LinkSpan
scan(final CharSequence
input text
input
,
int
the index at which the trigger character for this scanner was
triggerIndex
,
int
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
rewindIndex
)

Implements org.nibor.autolink.internal.Scanner.scan.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WwwScannerback to summary
public WwwScanner()

Method Detail

findFirstback to summary
private static int findFirst(final CharSequence input, final int beginIndex, final int rewindIndex)
findLastback to summary
private static int findLast(final CharSequence input, final int beginIndex)
isAllowedback to summary
private static boolean isAllowed(char c)
isWwwback to summary
private static boolean isWww(final CharSequence input, final int triggerIndex)
scanback to summary
public LinkSpan scan(final CharSequence input, int triggerIndex, int rewindIndex)

Implements org.nibor.autolink.internal.Scanner.scan.

Parameters
input:CharSequence

Doc from org.nibor.autolink.internal.Scanner.scan.

input text

triggerIndex:int

Doc from org.nibor.autolink.internal.Scanner.scan.

the index at which the trigger character for this scanner was

rewindIndex:int

Doc from org.nibor.autolink.internal.Scanner.scan.

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:LinkSpan

Doc from org.nibor.autolink.internal.Scanner.scan.

the matched link, or null if no link matched

Annotations
@Override