com.bea.alcs.domain.catalogview.browsing.impl
Class FilterSeoUrl

java.lang.Object
  extended by com.bea.alcs.domain.catalogview.browsing.impl.FilterSeoUrl

public class FilterSeoUrl
extends java.lang.Object

Encapsulates the logic required to build a SEO url for a filter.


Constructor Summary
FilterSeoUrl(java.util.Locale locale, java.util.List<Filter<?>> filters, SortBy sortType, SortOrder sortOrder, int pageNumber, java.lang.String fieldSeparator)
          Create an instance that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).
FilterSeoUrl(java.util.Locale locale, java.util.List<Filter<?>> filters, SortBy sortType, SortOrder sortOrder, java.lang.String fieldSeparator)
          Create an instance that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).
FilterSeoUrl(java.util.Locale locale, SortBy sortType, SortOrder sortOrder, java.lang.String fieldSeparator)
          Create an instance that filters will be added to later which will use the specified locale and sorter objects during the URL construction.
 
Method Summary
 void addFilter(Filter<?> filter)
          Add a filter to the existing list of filters.
 java.lang.String asString()
          Return a string representation of the url with the current set of filters that have been added.
 void setFieldSeparator(java.lang.String fieldSeparator)
          Set the field separator - used to encode the filename part of the url so that the specific product or category can be identified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterSeoUrl

public FilterSeoUrl(java.util.Locale locale,
                    SortBy sortType,
                    SortOrder sortOrder,
                    java.lang.String fieldSeparator)
Create an instance that filters will be added to later which will use the specified locale and sorter objects during the URL construction.

Parameters:
locale - the locale the url fragments should be in
sortType - the type of sorting to perform
sortOrder - the order of the sorting
fieldSeparator - the string used to separate the filename tokens.

FilterSeoUrl

public FilterSeoUrl(java.util.Locale locale,
                    java.util.List<Filter<?>> filters,
                    SortBy sortType,
                    SortOrder sortOrder,
                    java.lang.String fieldSeparator)
Create an instance that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).

Parameters:
locale - the locale the url fragments should be in.
filters - the list of filters that should be included in this url, more may be appended with addFilter(Filter).
sortType - the type of sorting to perform
sortOrder - the order of the sorting
fieldSeparator - the string to use to separate the filename tokens.

FilterSeoUrl

public FilterSeoUrl(java.util.Locale locale,
                    java.util.List<Filter<?>> filters,
                    SortBy sortType,
                    SortOrder sortOrder,
                    int pageNumber,
                    java.lang.String fieldSeparator)
Create an instance that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).

Parameters:
locale - the locale the url fragments should be in.
filters - the list of filters that should be included in this url, more may be appended with addFilter(Filter).
sortType - the type of sorting to perform
sortOrder - the order of the sorting
pageNumber - the page number to include in the url. This is ignored if it is less than zero.
fieldSeparator - the string to use to separate the filename tokens.
Method Detail

addFilter

public void addFilter(Filter<?> filter)
Add a filter to the existing list of filters. The filter will be represented in the correct place in the url, depending on it's type.

Parameters:
filter - the filter to add to the url.

asString

public java.lang.String asString()
Return a string representation of the url with the current set of filters that have been added.

Returns:
an seo representing the current state fo the object.

setFieldSeparator

public void setFieldSeparator(java.lang.String fieldSeparator)
Set the field separator - used to encode the filename part of the url so that the specific product or category can be identified.

Parameters:
fieldSeparator - the string to separate the filename part of the url with.