Class AbstractUrlResolver<T>
- java.lang.Object
-
- de.hybris.platform.commerceservices.url.impl.AbstractUrlResolver<T>
-
- Type Parameters:
T
- the source type to resolve into a url
- All Implemented Interfaces:
UrlResolver<T>
- Direct Known Subclasses:
DefaulCustomPageUrlResolver
,DefaultCategoryDataUrlResolver
,DefaultCategoryModelUrlResolver
,DefaultContentPageUrlResolver
,DefaultHomepageContentPageUrlResolver
,DefaultPointOfServiceUrlResolver
,DefaultProductDataUrlResolver
,DefaultProductModelUrlResolver
,OrdermanagementOrderEntryUrlResolver
,VendorUrlResolver
,WarehousingWarehouseUrlResolver
,WsProductModelUrlResolver
public abstract class AbstractUrlResolver<T> extends java.lang.Object implements UrlResolver<T>
Abstract url resolver that provides support methods for url resolvers.
-
-
Constructor Summary
Constructors Constructor Description AbstractUrlResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getKey(T source)
Get the cache key for the source instance.protected ThreadContextService
getThreadContextService()
java.lang.String
resolve(T source)
Resolve the url path for the source type.protected abstract java.lang.String
resolveInternal(T source)
Resolve the url path for the source type.void
setThreadContextService(ThreadContextService threadContextService)
protected java.lang.String
urlEncode(java.lang.String source)
Url encodes a stringprotected java.lang.String
urlSafe(java.lang.String text)
Encode string with UTF8 encoding and then convert a string into a URL safe version of the string.
-
-
-
Method Detail
-
getThreadContextService
protected ThreadContextService getThreadContextService()
-
setThreadContextService
public void setThreadContextService(ThreadContextService threadContextService)
-
urlSafe
protected java.lang.String urlSafe(java.lang.String text)
Encode string with UTF8 encoding and then convert a string into a URL safe version of the string. Only upper and lower case letters and numbers are retained. All other characters are replaced by a hyphen (-).- Parameters:
text
- the text to sanitize- Returns:
- the safe version of the text
-
urlEncode
protected java.lang.String urlEncode(java.lang.String source)
Url encodes a string- Parameters:
source
- A string to encode- Returns:
- A Url encoded string
-
getKey
protected java.lang.String getKey(T source)
Get the cache key for the source instance.- Parameters:
source
- the source instance- Returns:
- the cache key or null if caching is not supported
-
resolve
public java.lang.String resolve(T source)
Description copied from interface:UrlResolver
Resolve the url path for the source type.- Specified by:
resolve
in interfaceUrlResolver<T>
- Parameters:
source
- the source type.- Returns:
- the URL path
-
resolveInternal
protected abstract java.lang.String resolveInternal(T source)
Resolve the url path for the source type.- Parameters:
source
- the source type.- Returns:
- the URL path
-
-