Class 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 a Link object with the metadata of the resolved link.
      boolean isValid()
      Returns true if the link was resolved successful.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceLink

        public ResourceLink()
    • Method Detail

      • getMetadata

        @NotNull
        public @NotNull Link getMetadata()
        Returns a Link object with the metadata of the resolved link. Result is never null, check for validness with the Link.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