Class AbstractValueResolver<T extends ItemModel,M,Q>
java.lang.Object
de.hybris.platform.solrfacetsearch.provider.impl.AbstractValueResolver<T,M,Q>
- Type Parameters:
T- the type of the modelM- the type of the data that is valid in the context of a modelQ- the type of the data that is valid in the context of a model and qualifier
- All Implemented Interfaces:
QualifierProviderAware,ValueResolver<T>
- Direct Known Subclasses:
BackofficeValueResolver,BaseProductValueResolver,CollectionValueResolver,CustomerCouponCodeValueResolver,DataQualityValueResolver,DateValueResolver,EnumValueResolver,ItemModelLabelValueResolver,ItemModelPKValueResolver,ModelAttributesValueResolver,ProductClassificationAttributesValueResolver,ProductImagesValueResolver,ProductKeywordsValueResolver,ProductPricesValueResolver,ProductPromotionAttributesValueResolver,ProductUrlsValueResolver,ProductVendorValueResolver,RandomNumberValueResolver,RandomStringValueResolver,ReferenceValueResolver,TypeCodeValueResolver,VariantAwareCategoryCodeValueResolver,VariantAwareCategoryPKValueResolver
public abstract class AbstractValueResolver<T extends ItemModel,M,Q>
extends Object
implements ValueResolver<T>, QualifierProviderAware
Abstract class for value resolvers that want to use a
QualifierProvider-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddFieldValue(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value, String qualifier) protected abstract voidaddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<M, Q> resolverContext) protected voidprotected voiddoResolve(InputDocument document, IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) protected booleanfilterAndAddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value, String qualifier) protected ObjectfilterFieldValue(IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value) Returns the qualifier provider.protected MloadData(IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) Loads data that is valid in the context of a model.protected QloadQualifierData(IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model, Qualifier qualifier) Loads data that is valid in the context of a model and qualifier.protected voidvoidresolve(InputDocument document, IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) Resolves the values to be indexed.voidsetQualifierProvider(QualifierProvider qualifierProvider) Sets the qualifier provider.voidsetSessionService(SessionService sessionService) voidsetValueFilters(Collection<ValueFilter> valueFilters)
-
Constructor Details
-
AbstractValueResolver
public AbstractValueResolver()
-
-
Method Details
-
getSessionService
-
setSessionService
-
getQualifierProvider
Description copied from interface:QualifierProviderAwareReturns the qualifier provider.- Specified by:
getQualifierProviderin interfaceQualifierProviderAware- Returns:
- the qualifier provider.
-
setQualifierProvider
Description copied from interface:QualifierProviderAwareSets the qualifier provider.- Specified by:
setQualifierProviderin interfaceQualifierProviderAware- Parameters:
qualifierProvider- - the qualifier provider
-
getValueFilters
-
setValueFilters
-
resolve
public void resolve(InputDocument document, IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) throws FieldValueProviderException Description copied from interface:ValueResolverResolves the values to be indexed. The indexed properties that use the same value resolver are grouped and this method is called once for each one of these groups.- Specified by:
resolvein interfaceValueResolver<T extends ItemModel>- Parameters:
document- - document that will be indexed, all the resolved values should be added as fields to this documentbatchContext- - 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
-
doResolve
protected void doResolve(InputDocument document, IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) throws FieldValueProviderException - Throws:
FieldValueProviderException
-
loadData
protected M loadData(IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model) throws FieldValueProviderException Loads data that is valid in the context of a model.- 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
-
loadQualifierData
protected Q loadQualifierData(IndexerBatchContext batchContext, Collection<IndexedProperty> indexedProperties, T model, Qualifier qualifier) throws FieldValueProviderException Loads data that is valid in the context of a model and qualifier.- 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
-
addFieldValues
protected abstract void addFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<M, Q> resolverContext) throws FieldValueProviderException- Throws:
FieldValueProviderException
-
filterFieldValue
protected Object filterFieldValue(IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value) -
addFieldValue
protected boolean addFieldValue(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value, String qualifier) throws FieldValueProviderException - Throws:
FieldValueProviderException
-
filterAndAddFieldValues
protected boolean filterAndAddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, Object value, String qualifier) throws FieldValueProviderException - Throws:
FieldValueProviderException
-
createLocalSessionContext
protected void createLocalSessionContext() -
removeLocalSessionContext
protected void removeLocalSessionContext()
-