Package io.wcm.handler.link
Class LinkArgs
java.lang.Object
io.wcm.handler.link.LinkArgs
- All Implemented Interfaces:
Cloneable
Holds parameters to influence the link resolving process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Custom clone-method forLinkArgs@NotNull LinkArgsdisableSuffixSelector(boolean value) Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIXin case a suffix is present for building the URL.@NotNull LinkArgsdummyLink(boolean value) Set dummy link mode.@NotNull LinkArgsdummyLinkUrl(@Nullable String value) Set dummy link URL.boolean@NotNull LinkArgsSet extension.@NotNull LinkArgsSet fragment.@Nullable StringGet dummy link URL.@Nullable StringGet extension.@Nullable StringGet fragment.@Nullable String[]Get link target URL fallback property.@Nullable String[]Get link target window target fallback property.@NotNull org.apache.sling.api.resource.ValueMapCustom properties that my be used by application-specific markup builders or processors.@Nullable StringGet query string.@Nullable StringGet selectors.@Nullable StringGet suffix.@Nullable io.wcm.handler.url.UrlModeGet URL mode.@Nullable io.wcm.handler.url.VanityModeGet vanity mode.@Nullable StringGet window target.inthashCode()booleanDisable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIXin case a suffix is present for building the URL.booleanCheck if dummy link mode is enabled.@NotNull LinkArgslinkTargetUrlFallbackProperty(@NotNull String @Nullable ... propertyNames) Defines a "fallback" property name that is used to load link target information from a single property instead of the link type + link type depending property name.@NotNull LinkArgslinkTargetWindowTargetFallbackProperty(@NotNull String @Nullable ... propertyNames) Defines a "fallback" property name that is used to load the "windows target" information from instead of the the default property.@NotNull LinkArgsproperties(@NotNull Map<String, Object> map) Custom properties that my be used by application-specific markup builders or processors.@NotNull LinkArgsCustom properties that my be used by application-specific markup builders or processors.@NotNull LinkArgsqueryString(@Nullable String value) Set query string.@NotNull LinkArgsSet selectors.@NotNull LinkArgsSet suffix.toString()@NotNull LinkArgsurlMode(@Nullable io.wcm.handler.url.UrlMode value) Set URL mode.@NotNull LinkArgsvanityMode(@Nullable io.wcm.handler.url.VanityMode value) Set vanity mode.@NotNull LinkArgswindowTarget(@Nullable String value) Set window target.
-
Constructor Details
-
LinkArgs
public LinkArgs()
-
-
Method Details
-
getUrlMode
@Nullable public @Nullable io.wcm.handler.url.UrlMode getUrlMode()Get URL mode.- Returns:
- URL mode for externalizing the URL
-
getVanityMode
@Nullable public @Nullable io.wcm.handler.url.VanityMode getVanityMode()Get vanity mode.- Returns:
- Vanity mode for building the URL
-
urlMode
Set URL mode.- Parameters:
value- URL mode for externalizing the URL- Returns:
- this
-
vanityMode
@NotNull public @NotNull LinkArgs vanityMode(@Nullable @Nullable io.wcm.handler.url.VanityMode value) Set vanity mode.- Parameters:
value- Vanity mode for building the URL- Returns:
- this
-
isDummyLink
public boolean isDummyLink()Check if dummy link mode is enabled.- Returns:
- If set to true, link handler returns a dummy link in edit mode when link is invalid.
-
dummyLink
Set dummy link mode.- Parameters:
value- If set to true, link handler returns a dummy link in edit mode when link is invalid.- Returns:
- this
-
getDummyLinkUrl
Get dummy link URL.- Returns:
- Custom dummy link url. If null default dummy url is used.
-
dummyLinkUrl
Set dummy link URL.- Parameters:
value- Custom dummy link url. If null default dummy url is used.- Returns:
- this
-
getSelectors
Get selectors.- Returns:
- Selector string
-
selectors
Set selectors.- Parameters:
value- Selector string- Returns:
- this
-
getExtension
Get extension.- Returns:
- File extension
-
extension
Set extension.- Parameters:
value- File extension- Returns:
- this
-
getSuffix
Get suffix.- Returns:
- Suffix string
-
suffix
Set suffix.- Parameters:
value- Suffix string- Returns:
- this
-
getQueryString
Get query string.- Returns:
- Query parameters string (properly url-encoded)
-
queryString
Set query string.- Parameters:
value- Query parameters string (properly url-encoded)- Returns:
- this
-
getFragment
Get fragment.- Returns:
- Fragment identifier
-
fragment
Set fragment.- Parameters:
value- Fragment identifier- Returns:
- this
-
getWindowTarget
Get window target.- Returns:
- Link window target
-
windowTarget
Set window target.- Parameters:
value- Link window target- Returns:
- this
-
isDisableSuffixSelector
public boolean isDisableSuffixSelector()Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIXin case a suffix is present for building the URL. Although recommended as best practice, this can be omitted if you are sure your URLs are always either include a suffix or never do, so there is no risk for file name clashes in dispatcher cache.- Returns:
- If set to true, no additional suffix selector is added
-
disableSuffixSelector
Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIXin case a suffix is present for building the URL. Although recommended as best practice, this can be omitted if you are sure your URLs are always either include a suffix or never do, so there is no risk for file name clashes in dispatcher cache.- Parameters:
value- If set to true, no additional suffix selector is added- Returns:
- this
-
properties
Custom properties that my be used by application-specific markup builders or processors.- Parameters:
map- Property map. Is merged with properties already set.- Returns:
- this
-
property
@NotNull public @NotNull LinkArgs property(@NotNull @NotNull String key, @Nullable @Nullable Object value) Custom properties that my be used by application-specific markup builders or processors.- Parameters:
key- Property keyvalue- Property value- Returns:
- this
-
getProperties
@NotNull public @NotNull org.apache.sling.api.resource.ValueMap getProperties()Custom properties that my be used by application-specific markup builders or processors.- Returns:
- Value map
-
linkTargetUrlFallbackProperty
@NotNull public @NotNull LinkArgs linkTargetUrlFallbackProperty(@NotNull @NotNull String @Nullable ... propertyNames) Defines a "fallback" property name that is used to load link target information from a single property instead of the link type + link type depending property name. This property is used for migration from components that do not support Link Handler. It is only used for reading, and never written back to. When opened and saved in the link dialog, the property is removed and instead the dedicated properties are used.- Parameters:
propertyNames- Property name(s)- Returns:
- this
-
getLinkTargetUrlFallbackProperty
Get link target URL fallback property.- Returns:
- Property name(s)
-
linkTargetWindowTargetFallbackProperty
@NotNull public @NotNull LinkArgs linkTargetWindowTargetFallbackProperty(@NotNull @NotNull String @Nullable ... propertyNames) Defines a "fallback" property name that is used to load the "windows target" information from instead of the the default property. This property is used for migration from components that do not support Link Handler. It is only used for reading, and never written back to. When opened and saved in the link dialog, the property is removed and instead the dedicated properties are used.- Parameters:
propertyNames- Property name(s)- Returns:
- this
-
getLinkTargetWindowTargetFallbackProperty
Get link target window target fallback property.- Returns:
- Property name(s)
-
hashCode
public int hashCode() -
equals
-
toString
-
clone
Custom clone-method forLinkArgs
-