com.elasticpath.domain.catalogview.impl
Class AttributeValueFilterImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.catalogview.impl.AbstractFilterImpl
              extended by com.elasticpath.domain.catalogview.impl.AttributeValueFilterImpl
All Implemented Interfaces:
AttributeFilter, AttributeValueFilter, Filter, EpDomain, Transient, java.io.Serializable, java.lang.Comparable

public class AttributeValueFilterImpl
extends AbstractFilterImpl
implements AttributeValueFilter

The implementation of AttributeFilter.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.elasticpath.domain.impl.AbstractTransientImpl
serialVersionUID
 
Fields inherited from interface com.elasticpath.domain.catalogview.AttributeValueFilter
VALUE_TOKENS
 
Fields inherited from interface com.elasticpath.domain.catalogview.Filter
ERROR_MSG, SEPARATOR, SEPARATOR_IN_REGEX
 
Constructor Summary
AttributeValueFilterImpl()
          Default constructor.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this object with the specified object for ordering.
 Attribute getAttribute()
          Get the attribute object.
 java.lang.String getAttributeFilterId(java.lang.String attributeKey, java.lang.String seoId)
          Generate and return an attribute filter id.
 java.lang.String getAttributeKey()
          Get the attribute key.
 AttributeService getAttributeService()
           
 java.lang.Object getAttributeValue()
           
 java.lang.String getDisplayName(java.util.Locale locale)
          Get the display name for the filter.
 java.util.Locale getLocale()
          Get the locale for this attribute.
 java.lang.String getSeoId()
          This method is not used.
 java.lang.String getSeoName(java.util.Locale locale)
          This method is not used.
 void initialize(java.lang.String filterId)
          Initialized the filter.
 boolean match(java.lang.Object obj)
          Check whether the given object matchs this filter.
 boolean matchAttributeMultiValue(AttributeValueWithType attributeValue)
           
 boolean matchAttributeValue(AttributeValueWithType attributeValue)
           
 void setAttribute(Attribute attribute)
           
 void setAttributeKey(java.lang.String attributeKey)
          Set the attribute Key.
 void setAttributeService(AttributeService attributeService)
           
 void setAttributeValue(java.lang.Object attributeValue)
          Set the attribute value.
 void setLocale(java.util.Locale locale)
          Set the locale for this attribute.
 
Methods inherited from class com.elasticpath.domain.catalogview.impl.AbstractFilterImpl
equals, filter, getId, hashCode, isLocalized, setId, setLocalized
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.catalogview.Filter
filter, getId, isLocalized, setId, setLocalized
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Constructor Detail

AttributeValueFilterImpl

public AttributeValueFilterImpl()
Default constructor. Initialize the attribute service.

Method Detail

compareTo

public int compareTo(java.lang.Object object)
Compares this object with the specified object for ordering.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the given object
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
EpDomainException - in case the given object is not a BrandFilter

getAttribute

public Attribute getAttribute()
Description copied from interface: AttributeFilter
Get the attribute object.

Specified by:
getAttribute in interface AttributeFilter
Returns:
the attribute

getAttributeFilterId

public java.lang.String getAttributeFilterId(java.lang.String attributeKey,
                                             java.lang.String seoId)
Generate and return an attribute filter id.

Parameters:
attributeKey - the attributeKey
seoId - the seoId
Returns:
an attribute filter id

getAttributeKey

public java.lang.String getAttributeKey()
Get the attribute key.

Specified by:
getAttributeKey in interface AttributeFilter
Returns:
the attributeKey

getAttributeService

public AttributeService getAttributeService()
Returns:
the attributeService

getAttributeValue

public java.lang.Object getAttributeValue()
Specified by:
getAttributeValue in interface AttributeValueFilter
Returns:
the attributeValue

getDisplayName

public java.lang.String getDisplayName(java.util.Locale locale)
Get the display name for the filter.

Specified by:
getDisplayName in interface Filter
Parameters:
locale - the given locale.
Returns:
the display name.

getLocale

public java.util.Locale getLocale()
Get the locale for this attribute.

Returns:
the locale

getSeoId

public java.lang.String getSeoId()
This method is not used.

Specified by:
getSeoId in interface Filter
Overrides:
getSeoId in class AbstractFilterImpl
Returns:
the SEO identifier of the filter with the given locale.

getSeoName

public java.lang.String getSeoName(java.util.Locale locale)
This method is not used.

Specified by:
getSeoName in interface Filter
Parameters:
locale - the locale
Returns:
the SEO url of the filter with the given locale.

initialize

public void initialize(java.lang.String filterId)
                throws EpCatalogViewRequestBindException
Initialized the filter.

Specified by:
initialize in interface Filter
Parameters:
filterId - the filterId
Throws:
EpCatalogViewRequestBindException - the exception

match

public boolean match(java.lang.Object obj)
Check whether the given object matchs this filter. Generally, the given object should be a product. Used in filting the product.

Specified by:
match in interface Filter
Parameters:
obj - the given object.
Returns:
true: the given object matchs with the filter.

matchAttributeMultiValue

public boolean matchAttributeMultiValue(AttributeValueWithType attributeValue)
Parameters:
attributeValue - the given attributeValue
Returns:
true when the attributeValue matchs with this filter.

matchAttributeValue

public boolean matchAttributeValue(AttributeValueWithType attributeValue)
Parameters:
attributeValue - the given attributeValue
Returns:
true when the attributeValue matchs with this filter.

setAttribute

public void setAttribute(Attribute attribute)
Parameters:
attribute - the attribute to set

setAttributeKey

public void setAttributeKey(java.lang.String attributeKey)
Set the attribute Key.

Specified by:
setAttributeKey in interface AttributeFilter
Parameters:
attributeKey - the attributeKey to set

setAttributeService

public void setAttributeService(AttributeService attributeService)
Parameters:
attributeService - the attributeService to set

setAttributeValue

public void setAttributeValue(java.lang.Object attributeValue)
Set the attribute value. The given value should be a String, and it should be convert to the AttributeValue.

Specified by:
setAttributeValue in interface AttributeValueFilter
Parameters:
attributeValue - the attributeValue to set

setLocale

public void setLocale(java.util.Locale locale)
Set the locale for this attribute.

Parameters:
locale - the locale to set