@ConsumerType public interface Link<T>
Describes a link target.
Since:
com.adobe.cq.wcm.core.components.commons.link 1.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    This property was used with Title v2, but is not used with Title v3 nor with any other components.
    static final String
    Property name for storing link target.
    static final String
    Deprecated.
    This property was used with Title v2, but is not used with Title v3 nor with any other components.
    static final String
    Default property name for storing link URL.
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable String
    The externalized URL which also contains the scheme and host information.
    default @NotNull Map<String,String>
    Returns a Map with attributes for HTML anchor tag for this link.
    default @Nullable String
    The mapped URL, which supports mapping and vanity path.
    default T
    Returns the referenced WCM/DAM object.
    default @Nullable String
    The link URL, supports context path and escaping.
    default boolean
    Checks if the link defined for the component is valid.
  • Field Details

  • Method Details

    • isValid

      default boolean isValid()
      Checks if the link defined for the component is valid.
      Returns:
      true if component has a valid link defined
      Since:
      com.adobe.cq.wcm.core.components.commons.link 1.0.0
    • getURL

      @Nullable default @Nullable String getURL()
      The link URL, supports context path and escaping.
      Returns:
      Link URL or null if link is invalid
    • getMappedURL

      @Nullable default @Nullable String getMappedURL()
      The mapped URL, which supports mapping and vanity path. This usually is resource resolver mapping.
      Returns:
      Mapped link URL or null if link is invalid or no processing can be done
    • getExternalizedURL

      @Nullable default @Nullable String getExternalizedURL()
      The externalized URL which also contains the scheme and host information. This is usually created with a Externalizer service
      Returns:
      Full link URL or null if link is invalid or can't be externalized.
    • getHtmlAttributes

      @NotNull default @NotNull Map<String,String> getHtmlAttributes()
      Returns a Map with attributes for HTML anchor tag for this link. This usually also contains the Link URL as href attribute, but may contain additional attributes like target and others.
      Returns:
      Map with HTML-specific anchor attributes, or an empty map if link is invalid
      Since:
      com.adobe.cq.wcm.core.components.commons.link 1.0.0
    • getReference

      @Nullable default T getReference()
      Returns the referenced WCM/DAM object.
      Returns:
      Target page or null
      Since:
      com.adobe.cq.wcm.core.components.commons.link 1.0.0