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 Object implements UrlResolver<T>
Abstract url resolver that provides support methods for url resolvers.
  • Constructor Details

    • AbstractUrlResolver

      public AbstractUrlResolver()
  • Method Details

    • getThreadContextService

      protected ThreadContextService getThreadContextService()
    • setThreadContextService

      public void setThreadContextService(ThreadContextService threadContextService)
    • urlSafe

      protected String urlSafe(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 String urlEncode(String source)
      Url encodes a string
      Parameters:
      source - A string to encode
      Returns:
      A Url encoded string
    • getKey

      protected 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 String resolve(T source)
      Description copied from interface: UrlResolver
      Resolve the url path for the source type.
      Specified by:
      resolve in interface UrlResolver<T>
      Parameters:
      source - the source type.
      Returns:
      the URL path
    • resolveInternal

      protected abstract String resolveInternal(T source)
      Resolve the url path for the source type.
      Parameters:
      source - the source type.
      Returns:
      the URL path