Package io.wcm.handler.link.spi
Class LinkType
- java.lang.Object
-
- io.wcm.handler.link.spi.LinkType
-
- Direct Known Subclasses:
ExternalLinkType,InternalCrossContextLinkType,InternalCrossScopeLinkType,InternalLinkType,MediaLinkType
@ConsumerType public abstract class LinkType extends Object
Defines a link type supported byLinkHandler.This interface has to be implemented by a Sling Model class. The adaptables should be
SlingHttpServletRequestandResource.
-
-
Constructor Summary
Constructors Constructor Description LinkType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaccepts(@NotNull LinkRequest linkRequest)Checks whether a link reference can be handled by this link typeabstract booleanaccepts(@NotNull String linkRef)Checks whether a link reference string can be handled by this link typeabstract @NotNull StringgetId()@NotNull StringgetLabel()abstract @Nullable StringgetPrimaryLinkRefProperty()abstract @NotNull LinkresolveLink(@NotNull Link link)Resolves a link
-
-
-
Method Detail
-
getId
@NotNull public abstract @NotNull String getId()
- Returns:
- Link type ID (is stored as identifier in repository)
-
getLabel
@NotNull public @NotNull String getLabel()
- Returns:
- Link type label (displayed in link dialogs)
-
getPrimaryLinkRefProperty
@Nullable public abstract @Nullable String getPrimaryLinkRefProperty()
- Returns:
- Name of the property in which the primary link reference is stored
-
accepts
public boolean accepts(@NotNull @NotNull LinkRequest linkRequest)Checks whether a link reference can be handled by this link type- Parameters:
linkRequest- Link reference- Returns:
- true if this link type can handle the given link reference
-
accepts
public abstract boolean accepts(@NotNull @NotNull String linkRef)Checks whether a link reference string can be handled by this link type- Parameters:
linkRef- Link reference string- Returns:
- true if this link type can handle the given link reference
-
-