Package io.wcm.handler.link
Class LinkArgs
- java.lang.Object
-
- io.wcm.handler.link.LinkArgs
-
- All Implemented Interfaces:
java.lang.Cloneable
@ProviderType public final class LinkArgs extends java.lang.Object implements java.lang.Cloneable
Holds parameters to influence the link resolving process.
-
-
Constructor Summary
Constructors Constructor Description LinkArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkArgs
clone()
Custom clone-method forLinkArgs
@NotNull LinkArgs
disableSuffixSelector(boolean value)
Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIX
in case a suffix is present for building the URL.@NotNull LinkArgs
dummyLink(boolean value)
@NotNull LinkArgs
dummyLinkUrl(@Nullable java.lang.String value)
boolean
equals(java.lang.Object obj)
@NotNull LinkArgs
extension(@Nullable java.lang.String value)
@NotNull LinkArgs
fragment(@Nullable java.lang.String value)
@Nullable java.lang.String
getDummyLinkUrl()
@Nullable java.lang.String
getExtension()
@Nullable java.lang.String
getFragment()
@Nullable java.lang.String[]
getLinkTargetUrlFallbackProperty()
@Nullable java.lang.String[]
getLinkTargetWindowTargetFallbackProperty()
@NotNull org.apache.sling.api.resource.ValueMap
getProperties()
Custom properties that my be used by application-specific markup builders or processors.@Nullable java.lang.String
getQueryString()
@Nullable java.lang.String
getSelectors()
@Nullable java.lang.String
getSuffix()
@Nullable io.wcm.handler.url.UrlMode
getUrlMode()
@Nullable io.wcm.handler.url.VanityMode
getVanityMode()
@Nullable java.lang.String
getWindowTarget()
int
hashCode()
boolean
isDisableSuffixSelector()
Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIX
in case a suffix is present for building the URL.boolean
isDummyLink()
@NotNull LinkArgs
linkTargetUrlFallbackProperty(@NotNull java.lang.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 LinkArgs
linkTargetWindowTargetFallbackProperty(@NotNull java.lang.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 LinkArgs
properties(@NotNull java.util.Map<java.lang.String,java.lang.Object> map)
Custom properties that my be used by application-specific markup builders or processors.@NotNull LinkArgs
property(@NotNull java.lang.String key, @Nullable java.lang.Object value)
Custom properties that my be used by application-specific markup builders or processors.@NotNull LinkArgs
queryString(@Nullable java.lang.String value)
@NotNull LinkArgs
selectors(@Nullable java.lang.String value)
@NotNull LinkArgs
suffix(@Nullable java.lang.String value)
java.lang.String
toString()
@NotNull LinkArgs
urlMode(@Nullable io.wcm.handler.url.UrlMode value)
@NotNull LinkArgs
vanityMode(@Nullable io.wcm.handler.url.VanityMode value)
@NotNull LinkArgs
windowTarget(@Nullable java.lang.String value)
-
-
-
Method Detail
-
getUrlMode
@Nullable public @Nullable io.wcm.handler.url.UrlMode getUrlMode()
- Returns:
- URL mode for externalizing the URL
-
getVanityMode
@Nullable public @Nullable io.wcm.handler.url.VanityMode getVanityMode()
- Returns:
- Vanity mode for building the URL
-
urlMode
@NotNull public @NotNull LinkArgs urlMode(@Nullable @Nullable io.wcm.handler.url.UrlMode value)
- Parameters:
value
- URL mode for externalizing the URL- Returns:
- this
-
vanityMode
@NotNull public @NotNull LinkArgs vanityMode(@Nullable @Nullable io.wcm.handler.url.VanityMode value)
- Parameters:
value
- Vanity mode for building the URL- Returns:
- this
-
isDummyLink
public boolean isDummyLink()
- Returns:
- If set to true, link handler returns a dummy link in edit mode when link is invalid.
-
dummyLink
@NotNull public @NotNull LinkArgs dummyLink(boolean value)
- Parameters:
value
- If set to true, link handler returns a dummy link in edit mode when link is invalid.- Returns:
- this
-
getDummyLinkUrl
@Nullable public @Nullable java.lang.String getDummyLinkUrl()
- Returns:
- Custom dummy link url. If null default dummy url is used.
-
dummyLinkUrl
@NotNull public @NotNull LinkArgs dummyLinkUrl(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Custom dummy link url. If null default dummy url is used.- Returns:
- this
-
getSelectors
@Nullable public @Nullable java.lang.String getSelectors()
- Returns:
- Selector string
-
selectors
@NotNull public @NotNull LinkArgs selectors(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Selector string- Returns:
- this
-
getExtension
@Nullable public @Nullable java.lang.String getExtension()
- Returns:
- File extension
-
extension
@NotNull public @NotNull LinkArgs extension(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- File extension- Returns:
- this
-
getSuffix
@Nullable public @Nullable java.lang.String getSuffix()
- Returns:
- Suffix string
-
suffix
@NotNull public @NotNull LinkArgs suffix(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Suffix string- Returns:
- this
-
getQueryString
@Nullable public @Nullable java.lang.String getQueryString()
- Returns:
- Query parameters string (properly url-encoded)
-
queryString
@NotNull public @NotNull LinkArgs queryString(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Query parameters string (properly url-encoded)- Returns:
- this
-
getFragment
@Nullable public @Nullable java.lang.String getFragment()
- Returns:
- Fragment identifier
-
fragment
@NotNull public @NotNull LinkArgs fragment(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Fragment identifier- Returns:
- this
-
getWindowTarget
@Nullable public @Nullable java.lang.String getWindowTarget()
- Returns:
- Link window target
-
windowTarget
@NotNull public @NotNull LinkArgs windowTarget(@Nullable @Nullable java.lang.String value)
- Parameters:
value
- Link window target- Returns:
- this
-
isDisableSuffixSelector
public boolean isDisableSuffixSelector()
Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIX
in 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
@NotNull public @NotNull LinkArgs disableSuffixSelector(boolean value)
Disable the automatic addition of an additional selectorUrlHandler.SELECTOR_SUFFIX
in 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
@NotNull public @NotNull LinkArgs properties(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> map)
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 java.lang.String key, @Nullable @Nullable java.lang.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 java.lang.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
@Nullable public @Nullable java.lang.String[] getLinkTargetUrlFallbackProperty()
- Returns:
- Property name(s)
-
linkTargetWindowTargetFallbackProperty
@NotNull public @NotNull LinkArgs linkTargetWindowTargetFallbackProperty(@NotNull @NotNull java.lang.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
@Nullable public @Nullable java.lang.String[] getLinkTargetWindowTargetFallbackProperty()
- Returns:
- Property name(s)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-