Class ModelAttributesValueResolver<T extends ItemModel>
- java.lang.Object
-
- de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver<T,java.lang.Object,java.lang.Object>
-
- de.hybris.platform.solrfacetsearch.provider.impl.ModelAttributesValueResolver<T>
-
- All Implemented Interfaces:
QualifierProviderAware,ValueResolver<T>
- Direct Known Subclasses:
ProductAttributesValueResolver
public class ModelAttributesValueResolver<T extends ItemModel> extends AbstractValueResolver<T,java.lang.Object,java.lang.Object>
Resolver that gets the values from attributes on the 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. 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. format null The ID of the Format Bean that is going to be used to format the attribute value object before applying the split 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 ModelAttributesValueResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<java.lang.Object,java.lang.Object> resolverContext)protected java.lang.StringgetAttributeName(IndexedProperty indexedProperty)protected java.lang.ObjectgetAttributeValue(IndexedProperty indexedProperty, T model, java.lang.String attributeName)ExpressionEvaluatorgetExpressionEvaluator()ModelServicegetModelService()TypeServicegetTypeService()voidsetExpressionEvaluator(ExpressionEvaluator expressionEvaluator)voidsetModelService(ModelService modelService)voidsetTypeService(TypeService typeService)-
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
-
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
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getExpressionEvaluator
public ExpressionEvaluator getExpressionEvaluator()
-
setExpressionEvaluator
public void setExpressionEvaluator(ExpressionEvaluator expressionEvaluator)
-
addFieldValues
protected void addFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<java.lang.Object,java.lang.Object> resolverContext) throws FieldValueProviderException
- Specified by:
addFieldValuesin classAbstractValueResolver<T extends ItemModel,java.lang.Object,java.lang.Object>- Throws:
FieldValueProviderException
-
getAttributeName
protected java.lang.String getAttributeName(IndexedProperty indexedProperty)
-
getAttributeValue
protected java.lang.Object getAttributeValue(IndexedProperty indexedProperty, T model, java.lang.String attributeName) throws FieldValueProviderException
- Throws:
FieldValueProviderException
-
-