@FunctionalInterface
public interface ContentLinkUrlResolver
An implementation of this can be provided to via
DeliveryClient.setContentLinkUrlResolver(ContentLinkUrlResolver) to resolve links to a content item that are
published. This is passed on to the RichTextElementConverter to update href attributes in links when
a data-item-id is available on the link.
This is a FunctionalInterface to simplify implementation.
For example, the following implementation will render <a href="/LINK_TYPE/LINK_URL_SLUG">Some text</a>:
DeliveryClient deliveryClient = new DeliveryClient("02a70003-e864-464e-b62c-e0ede97deb8c");
deliveryClient.setContentLinkUrlResolver(link -> String.format("/%s/%s", link.getType(), link.getUrlSlug()));
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
resolveLinkUrl(Link link)
Returns a String to be placed in the href attribute of any links to content items that are published within
RichTextElements. |
java.lang.String resolveLinkUrl(Link link)
RichTextElements.link - The link that needs to be resolved to a url.