Class ProductAttributesValueResolver
- java.lang.Object
-
- de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver<T,java.lang.Object,java.lang.Object>
-
- de.hybris.platform.solrfacetsearch.provider.impl.ModelAttributesValueResolver<ProductModel>
-
- de.hybris.platform.commerceservices.search.solrfacetsearch.provider.impl.ProductAttributesValueResolver
-
- All Implemented Interfaces:
QualifierProviderAware,ValueResolver<ProductModel>
public class ProductAttributesValueResolver extends ModelAttributesValueResolver<ProductModel>
Resolver for product attributes. It takes into consideration variant product attributes (but not generic variant attributes). If a value if not found for a variant it tries to get it from the base product. By default, if parameter attribute is not specified, it tries to get the attribute with the same name as the one configured on the indexed property.Supported parameters:
Parameter Default value Description optional true If false, indicates that the resolved values should not be null and not an empty string (for every qualifier). If these conditions are not met, an exception of type FieldValueProviderExceptionis thrown.attribute If specified, this is the name of the attribute. split false If true, splits any resolved value around matches of a regular expression (only if the value is of type String). splitRegex \s+ If split is true this is the regular expression to use. skipVariants If true, it ignores product variants and gets the values from the base product. format null The ID of the Format Bean that is going to be used to format the attribute value object before applying the split
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver
AbstractValueResolver.ValueResolverContext<T,U>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSKIP_VARIANTS_PARAMstatic booleanSKIP_VARIANTS_PARAM_DEFAULT_VALUE-
Fields inherited from class de.hybris.platform.solrfacetsearch.provider.impl.ModelAttributesValueResolver
ATTRIBUTE_PARAM, ATTRIBUTE_PARAM_DEFAULT_VALUE, EVALUATE_EXPRESSION_PARAM, EVALUATE_EXPRESSION_PARAM_DEFAULT_VALUE, OPTIONAL_PARAM, OPTIONAL_PARAM_DEFAULT_VALUE
-
-
Constructor Summary
Constructors Constructor Description ProductAttributesValueResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectgetAttributeValue(IndexedProperty indexedProperty, ProductModel product, java.lang.String attributeName)protected java.lang.ObjectgetModelAttributeValue(ProductModel product, java.lang.String attributeName)protected java.lang.ObjectgetVariantProductAttributeValue(VariantProductModel variantProduct, java.lang.String attributeName)VariantsServicegetVariantsService()voidsetVariantsService(VariantsService variantsService)-
Methods inherited from class de.hybris.platform.solrfacetsearch.provider.impl.ModelAttributesValueResolver
addFieldValues, getAttributeName, getExpressionEvaluator, getModelService, getTypeService, setExpressionEvaluator, setModelService, setTypeService
-
Methods inherited from class de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver
addFieldValue, createLocalSessionContext, doResolve, filterAndAddFieldValues, filterFieldValue, getQualifierProvider, getSessionService, getValueFilters, loadData, loadQualifierData, removeLocalSessionContext, resolve, setQualifierProvider, setSessionService, setValueFilters
-
-
-
-
Field Detail
-
SKIP_VARIANTS_PARAM
public static final java.lang.String SKIP_VARIANTS_PARAM
- See Also:
- Constant Field Values
-
SKIP_VARIANTS_PARAM_DEFAULT_VALUE
public static final boolean SKIP_VARIANTS_PARAM_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVariantsService
public VariantsService getVariantsService()
-
setVariantsService
public void setVariantsService(VariantsService variantsService)
-
getAttributeValue
protected java.lang.Object getAttributeValue(IndexedProperty indexedProperty, ProductModel product, java.lang.String attributeName) throws FieldValueProviderException
- Overrides:
getAttributeValuein classModelAttributesValueResolver<ProductModel>- Throws:
FieldValueProviderException
-
getModelAttributeValue
protected java.lang.Object getModelAttributeValue(ProductModel product, java.lang.String attributeName)
-
getVariantProductAttributeValue
protected java.lang.Object getVariantProductAttributeValue(VariantProductModel variantProduct, java.lang.String attributeName)
-
-