public class EmailAddressAutoLinker extends Object implements AutoLinker
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
AT_SIGNS |
static Pattern |
VALID_EMAIL_ADDRESS |
static Pattern |
VALID_EMAIL_ADRESS_ML |
| Constructor and Description |
|---|
EmailAddressAutoLinker(boolean hexEncodeEmailAddress,
boolean obfuscateEmailAddress)
Instantiates a new email address autolinker.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.jsoup.nodes.Node> |
createLinks(org.jsoup.nodes.TextNode textNode)
Gets the content of
node and tries to find linkable content. |
String |
hexEncodeEmailAddress(String emailAddress)
Hex encodes an email addess, leaving the '@' intact.
|
String |
obfuscateEmailAddress(String emailAddress)
Obfuscates an email address. @ will be replaced throught " [AT] " and .
|
public static final Pattern VALID_EMAIL_ADDRESS
public static final Pattern VALID_EMAIL_ADRESS_ML
public static final Pattern AT_SIGNS
public EmailAddressAutoLinker(boolean hexEncodeEmailAddress,
boolean obfuscateEmailAddress)
hexEncodeEmailAddress - Should mailto: Addresses be hex-encoded?obfuscateEmailAddress - Should labels be obfuscated?public List<org.jsoup.nodes.Node> createLinks(org.jsoup.nodes.TextNode textNode)
AutoLinkernode and tries to find linkable content.
If content is found, create new text nodes before and after the content
and a new anchor element with the new link
createLinks in interface AutoLinkertextNode - The text node which may contain linkable textstextNodepublic String obfuscateEmailAddress(String emailAddress)
emailAddress - The email address to obfuscatepublic String hexEncodeEmailAddress(String emailAddress)
emailAddress - The email address that should be encoded to
hexadecimalCopyright © 2010–2016 michael-simons.eu. All rights reserved.