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 class
AbstractValueResolver.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 boolean
addFieldValue(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier)
protected abstract void
addFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, T model, AbstractValueResolver.ValueResolverContext<M,Q> resolverContext)
protected void
createLocalSessionContext()
protected void
doResolve(InputDocument document, IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)
protected boolean
filterAndAddFieldValues(InputDocument document, IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value, java.lang.String qualifier)
protected java.lang.Object
filterFieldValue(IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value)
QualifierProvider
getQualifierProvider()
Returns the qualifier provider.SessionService
getSessionService()
java.util.Collection<ValueFilter>
getValueFilters()
protected M
loadData(IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)
Loads data that is valid in the context of a model.protected Q
loadQualifierData(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 void
removeLocalSessionContext()
void
resolve(InputDocument document, IndexerBatchContext batchContext, java.util.Collection<IndexedProperty> indexedProperties, T model)
Resolves the values to be indexed.void
setQualifierProvider(QualifierProvider qualifierProvider)
Sets the qualifier provider.void
setSessionService(SessionService sessionService)
void
setValueFilters(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:QualifierProviderAware
Returns the qualifier provider.- Specified by:
getQualifierProvider
in interfaceQualifierProviderAware
- Returns:
- the qualifier provider.
-
setQualifierProvider
public void setQualifierProvider(QualifierProvider qualifierProvider)
Description copied from interface:QualifierProviderAware
Sets the qualifier provider.- Specified by:
setQualifierProvider
in 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:ValueResolver
Resolves 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:
resolve
in 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()
-
-