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,ReferenceValueResolver,TypeCodeValueResolver,VariantAwareCategoryCodeValueResolver,VariantAwareCategoryPKValueResolver
public abstract class AbstractValueResolver<T extends ItemModel,M,Q> extends java.lang.Object implements ValueResolver<T>, QualifierProviderAware
Abstract class for value resolvers that want to use aQualifierProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractValueResolver.ValueResolverContext<T,U>
-
Constructor Summary
Constructors Constructor Description AbstractValueResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanaddFieldValue(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier)protected abstract voidaddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<M,Q> resolverContext)protected voidcreateLocalSessionContext()protected voiddoResolve(InputDocument document, IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)protected booleanfilterAndAddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier)protected java.lang.ObjectfilterFieldValue(IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value)QualifierProvidergetQualifierProvider()Returns the qualifier provider.SessionServicegetSessionService()java.util.Collection<ValueFilter>getValueFilters()protected MloadData(IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)Loads data that is valid in the context of a model.protected QloadQualifierData(IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model, Qualifier qualifier)Loads data that is valid in the context of a model and qualifier.protected voidremoveLocalSessionContext()voidresolve(InputDocument document, IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)Resolves the values to be indexed.voidsetQualifierProvider(QualifierProvider qualifierProvider)Sets the qualifier provider.voidsetSessionService(SessionService sessionService)voidsetValueFilters(java.util.Collection<ValueFilter> valueFilters)
-
-
-
Method Detail
-
getSessionService
public SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getQualifierProvider
public QualifierProvider getQualifierProvider()
Description copied from interface:QualifierProviderAwareReturns the qualifier provider.- Specified by:
getQualifierProviderin interfaceQualifierProviderAware- Returns:
- the qualifier provider.
-
setQualifierProvider
public void setQualifierProvider(QualifierProvider qualifierProvider)
Description copied from interface:QualifierProviderAwareSets the qualifier provider.- Specified by:
setQualifierProviderin interfaceQualifierProviderAware- Parameters:
qualifierProvider- - the qualifier provider
-
getValueFilters
public java.util.Collection<ValueFilter> getValueFilters()
-
setValueFilters
public void setValueFilters(java.util.Collection<ValueFilter> valueFilters)
-
resolve
public void resolve(InputDocument document, IndexerBatchContext batchContext, java.util.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, java.util.Collection<IndexedProperty> indexedProperties, T model) throws FieldValueProviderException
- Throws:
FieldValueProviderException
-
loadData
protected M loadData(IndexerBatchContext batchContext, java.util.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, java.util.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 java.lang.Object filterFieldValue(IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value)
-
addFieldValue
protected boolean addFieldValue(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier) throws FieldValueProviderException
- Throws:
FieldValueProviderException
-
filterAndAddFieldValues
protected boolean filterAndAddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier) throws FieldValueProviderException
- Throws:
FieldValueProviderException
-
createLocalSessionContext
protected void createLocalSessionContext()
-
removeLocalSessionContext
protected void removeLocalSessionContext()
-
-