Package io.wcm.handler.link.ui
Class ResourceLink
- java.lang.Object
-
- io.wcm.handler.link.ui.ResourceLink
-
@Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class) public class ResourceLink extends java.lang.Object
Generic resource-based link model.
-
-
Constructor Summary
Constructors Constructor Description ResourceLink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.util.Map<java.lang.String,java.lang.String>
getAttributes()
Returns a map of attributes which can be applied to a HTML anchor element.@NotNull Link
getMetadata()
Returns aLink
object with the metadata of the resolved link.boolean
isValid()
Returns true if the link was resolved successful.
-
-
-
Method Detail
-
getMetadata
@NotNull public @NotNull Link getMetadata()
Returns aLink
object with the metadata of the resolved link. Result is never null, check for validness with theLink.isValid()
method.- Returns:
- Link
-
isValid
public boolean isValid()
Returns true if the link was resolved successful.- Returns:
- Link is valid
-
getAttributes
@Nullable public @Nullable java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns a map of attributes which can be applied to a HTML anchor element.- Returns:
- Anchor attributes
-
-