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 Object
Implements resolving an internal link for link types. The primary goal is to support the implementation for InternalLinkType, but it can be used by custom link type implementations as well.

The link resolving process can be customized by providing a customized InternalLinkResolverOptions object.

  • Constructor Details

    • InternalLinkResolver

      public InternalLinkResolver()
  • Method Details

    • 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 - Page
      options - 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 - Link
      options - Options to influence the link resolution process
      Returns:
      Resolved link object