Interface Link<T>
Describes a link target.
- Since:
- com.adobe.cq.wcm.core.components.commons.link 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.This property was used with Title v2, but is not used with Title v3 nor with any other components.static final StringProperty name for storing link target.static final StringDeprecated.This property was used with Title v2, but is not used with Title v3 nor with any other components.static final StringDefault property name for storing link URL. -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable StringThe externalized URL which also contains the scheme and host information.Returns a Map with attributes for HTML anchor tag for this link.default @Nullable StringThe mapped URL, which supports mapping and vanity path.default TReturns the referenced WCM/DAM object.default @Nullable StringgetURL()The link URL, supports context path and escaping.default booleanisValid()Checks if the link defined for the component is valid.
-
Field Details
-
PN_LINK_URL
Default property name for storing link URL. All new model implementation should use this name, some of the existing models use other names to store the link URL.- See Also:
-
PN_LINK_TARGET
Property name for storing link target.- See Also:
-
PN_LINK_ACCESSIBILITY_LABEL
Deprecated.This property was used with Title v2, but is not used with Title v3 nor with any other components.Property name for storing link accessibility label.- See Also:
-
PN_LINK_TITLE_ATTRIBUTE
Deprecated.This property was used with Title v2, but is not used with Title v3 nor with any other components.Property name for storing link title attribute.- See Also:
-
-
Method Details
-
isValid
default boolean isValid()Checks if the link defined for the component is valid.- Returns:
trueif component has a valid link defined- Since:
- com.adobe.cq.wcm.core.components.commons.link 1.0.0
-
getURL
The link URL, supports context path and escaping.- Returns:
- Link URL or
nullif link is invalid
-
getMappedURL
The mapped URL, which supports mapping and vanity path. This usually is resource resolver mapping.- Returns:
- Mapped link URL or
nullif link is invalid or no processing can be done
-
getExternalizedURL
The externalized URL which also contains the scheme and host information. This is usually created with aExternalizerservice- Returns:
- Full link URL or
nullif link is invalid or can't be externalized.
-
getHtmlAttributes
Returns a Map with attributes for HTML anchor tag for this link. This usually also contains the Link URL ashrefattribute, but may contain additional attributes liketargetand others.- Returns:
Mapwith 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
Returns the referenced WCM/DAM object.- Returns:
- Target page or
null - Since:
- com.adobe.cq.wcm.core.components.commons.link 1.0.0
-