public class AutoLinkService extends Object
| Constructor and Description |
|---|
AutoLinkService(List<AutoLinker> autolinkers) |
| Modifier and Type | Method and Description |
|---|---|
org.jsoup.nodes.Document |
addLinks(org.jsoup.nodes.Document document)
A convenience method for adding links in an existing document.
|
String |
addLinks(String textWithLinkableStuff,
Optional<String> baseUrl) |
<T> T |
addLinks(String textWithLinkableStuff,
Optional<String> baseUrl,
Class<? extends T> targetClass)
Looks through a text with linkable stuff and applies all configured
AutoLinker to this text. |
public AutoLinkService(List<AutoLinker> autolinkers)
public String addLinks(String textWithLinkableStuff, Optional<String> baseUrl)
textWithLinkableStuff - The text that contains possible urlsbaseUrl - Base url for creating absolute urls from relative urlsaddLinks(java.lang.String, java.util.Optional, java.lang.Class)public <T> T addLinks(String textWithLinkableStuff, Optional<String> baseUrl, Class<? extends T> targetClass)
AutoLinker to this text.T - Type of the resulting document with embedded linkstextWithLinkableStuff - A list that may contain urls and suchbaseUrl - An optional base url for resolving relative urlstargetClass - Class of the generated documentpublic org.jsoup.nodes.Document addLinks(org.jsoup.nodes.Document document)
document - Existing document, will be modifiedaddLinks(java.lang.String, java.util.Optional, java.lang.Class)Copyright © 2010–2016 michael-simons.eu. All rights reserved.