Interface LinkManager
-
@ConsumerType public interface LinkManager
This interface offers a flexible way, based on the builder pattern, to compute links. This is a Sling model that can be injected into other models using the@Selfannotation. It can be adapted from aSlingHttpServletRequest. It can be used as follows:Link link = linkManager.get(page).build(); Link link = linkManager.get(page) .withLinkTarget(...) .withLinkAttribute(...) .build();
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull LinkBuilderget(@NotNull Asset asset)Returns a link builder where the link points to an asset.@NotNull LinkBuilderget(@NotNull Page page)Returns a link builder where the link points to a page.@NotNull LinkBuilderget(@NotNull java.lang.String url)Returns a link builder where the link points to an URL.@NotNull LinkBuilderget(@NotNull Resource resource)Returns a link builder where the link is defined by the resource properties.
-
-
-
Method Detail
-
get
@NotNull @NotNull LinkBuilder get(@NotNull @NotNull Resource resource)
Returns a link builder where the link is defined by the resource properties.- Parameters:
resource- Resource to read the link properties from.- Returns:
LinkBuilder
-
get
@NotNull @NotNull LinkBuilder get(@NotNull @NotNull Page page)
Returns a link builder where the link points to a page.- Parameters:
page- Target page of the link.- Returns:
LinkBuilder
-
get
@NotNull @NotNull LinkBuilder get(@NotNull @NotNull Asset asset)
Returns a link builder where the link points to an asset.- Parameters:
asset- Target asset of the link.- Returns:
LinkBuilder
-
get
@NotNull @NotNull LinkBuilder get(@NotNull @NotNull java.lang.String url)
Returns a link builder where the link points to an URL.- Parameters:
url- URL string of the link.- Returns:
LinkBuilder
-
-