Top Description Fields Constructors Methods
org.nibor.autolink.internal

public Class EmailScanner

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

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

Modifier and TypeField and Description
private final boolean

Constructor Summary

AccessConstructor and Description
public
EmailScanner(boolean domainMustHaveDot)

Method Summary

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

private int
findLast(CharSequence input, int beginIndex)

private boolean
public LinkSpan
scan(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.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

domainMustHaveDotback to summary
private final boolean domainMustHaveDot

Constructor Detail

EmailScannerback to summary
public EmailScanner(boolean domainMustHaveDot)

Method Detail

findFirstback to summary
private int findFirst(CharSequence input, int beginIndex, int rewindIndex)
findLastback to summary
private int findLast(CharSequence input, int beginIndex)
localAtomAllowedback to summary
private boolean localAtomAllowed(char c)
scanback to summary
public LinkSpan scan(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
subDomainAllowedback to summary
private boolean subDomainAllowed(char c)