Class ProductPromotionAttributesValueResolver
- java.lang.Object
-
- de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver<ProductModel,java.util.Collection<ProductPromotionModel>,java.lang.Object>
-
- de.hybris.platform.commerceservices.search.solrfacetsearch.provider.impl.ProductPromotionAttributesValueResolver
-
- All Implemented Interfaces:
QualifierProviderAware,ValueResolver<ProductModel>
public class ProductPromotionAttributesValueResolver extends AbstractValueResolver<ProductModel,java.util.Collection<ProductPromotionModel>,java.lang.Object>
Resolver that gets the product promotion values from attributes on the promotion model. 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. evaluateExpression false If true the attribute name is assumed to be a spring expression language that need to be evaluated
-
-
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.StringATTRIBUTE_PARAMstatic java.lang.StringATTRIBUTE_PARAM_DEFAULT_VALUEstatic java.lang.StringEVALUATE_EXPRESSION_PARAMstatic booleanEVALUATE_EXPRESSION_PARAM_DEFAULT_VALUEstatic java.lang.StringOPTIONAL_PARAMstatic booleanOPTIONAL_PARAM_DEFAULT_VALUE
-
Constructor Summary
Constructors Constructor Description ProductPromotionAttributesValueResolver()
-
Method Summary
-
Methods inherited from class de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver
addFieldValue, createLocalSessionContext, doResolve, filterAndAddFieldValues, filterFieldValue, getQualifierProvider, getSessionService, getValueFilters, loadQualifierData, removeLocalSessionContext, resolve, setQualifierProvider, setSessionService, setValueFilters
-
-
-
-
Field Detail
-
OPTIONAL_PARAM
public static final java.lang.String OPTIONAL_PARAM
- See Also:
- Constant Field Values
-
OPTIONAL_PARAM_DEFAULT_VALUE
public static final boolean OPTIONAL_PARAM_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
ATTRIBUTE_PARAM
public static final java.lang.String ATTRIBUTE_PARAM
- See Also:
- Constant Field Values
-
ATTRIBUTE_PARAM_DEFAULT_VALUE
public static final java.lang.String ATTRIBUTE_PARAM_DEFAULT_VALUE
-
EVALUATE_EXPRESSION_PARAM
public static final java.lang.String EVALUATE_EXPRESSION_PARAM
- See Also:
- Constant Field Values
-
EVALUATE_EXPRESSION_PARAM_DEFAULT_VALUE
public static final boolean EVALUATE_EXPRESSION_PARAM_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPromotionsService
public PromotionsService getPromotionsService()
-
setPromotionsService
public void setPromotionsService(PromotionsService promotionsService)
-
getExpressionEvaluator
public ExpressionEvaluator getExpressionEvaluator()
-
setExpressionEvaluator
public void setExpressionEvaluator(ExpressionEvaluator expressionEvaluator)
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
addFieldValues
protected void addFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, ProductModel model, AbstractValueResolver.ValueResolverContext<java.util.Collection<ProductPromotionModel>,java.lang.Object> resolverContext) throws FieldValueProviderException
- Specified by:
addFieldValuesin classAbstractValueResolver<ProductModel,java.util.Collection<ProductPromotionModel>,java.lang.Object>- Throws:
FieldValueProviderException
-
getAttributeName
protected java.lang.String getAttributeName(IndexedProperty indexedProperty)
-
getAttributeValue
protected java.lang.Object getAttributeValue(IndexedProperty indexedProperty, IndexerBatchContext batchContext, ProductPromotionModel promotionModel, java.lang.String attributeName) throws FieldValueProviderException
- Throws:
FieldValueProviderException
-
loadData
protected java.util.Collection<ProductPromotionModel> loadData(IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, ProductModel model) throws FieldValueProviderException
Description copied from class:AbstractValueResolverLoads data that is valid in the context of a model.- Overrides:
loadDatain classAbstractValueResolver<ProductModel,java.util.Collection<ProductPromotionModel>,java.lang.Object>- Parameters:
batchContext- - the current indexer batch contextindexedProperties- - the indexed properties that use the same value resolvermodel- - the values should be resolved for this model instance- Throws:
FieldValueProviderException- if an error occurs
-
-