Package io.wcm.handler.link.type.helpers
Class InternalLinkResolver
- java.lang.Object
-
- io.wcm.handler.link.type.helpers.InternalLinkResolver
-
@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class}) @ProviderType public final class InternalLinkResolver extends java.lang.ObjectImplements resolving an internal link for link types. The primary goal is to support the implementation forInternalLinkType, but it can be used by custom link type implementations as well.The link resolving process can be customized by providing a customized
InternalLinkResolverOptionsobject.
-
-
Constructor Summary
Constructors Constructor Description InternalLinkResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptPage(@Nullable com.day.cq.wcm.api.Page page, @NotNull InternalLinkResolverOptions options)Check if a given page is valid and acceptable to link upon.@NotNull LinkresolveLink(@NotNull Link link, @NotNull InternalLinkResolverOptions options)Resolves a link and stores the result in the link object.
-
-
-
Method Detail
-
acceptPage
public boolean acceptPage(@Nullable @Nullable com.day.cq.wcm.api.Page page, @NotNull @NotNull InternalLinkResolverOptions options)Check if a given page is valid and acceptable to link upon.- Parameters:
page- Pageoptions- Options- Returns:
- true if link is acceptable
-
resolveLink
@NotNull public @NotNull Link resolveLink(@NotNull @NotNull Link link, @NotNull @NotNull InternalLinkResolverOptions options)
Resolves a link and stores the result in the link object. Primary it sets the property "linkReferenceInvalid" and the URL is link resolving was successful.- Parameters:
link- Linkoptions- Options to influence the link resolution process- Returns:
- Resolved link object
-
-