Class ValueBindingContextImpl<V>
java.lang.Object
org.hibernate.search.mapper.pojo.bridge.binding.impl.ValueBindingContextImpl<V>
- All Implemented Interfaces:
BindingContext,ValueBindingContext<V>
-
Constructor Summary
ConstructorsConstructorDescriptionValueBindingContextImpl(BeanResolver beanResolver, PojoBootstrapIntrospector introspector, PojoTypeModel<V> valueTypeModel, boolean multiValued, IndexBindingContext indexBindingContext, IndexFieldTypeDefaultsProvider defaultsProvider, String relativeFieldName, FieldModelContributor contributor, Map<String, Object> params) -
Method Summary
Modifier and TypeMethodDescriptionapplyBinder(ValueBinder binder) <V2,F> void bridge(Class<V2> expectedValueType, BeanHolder<? extends ValueBridge<V2, F>> bridgeHolder, IndexFieldTypeOptionsStep<?, F> fieldTypeOptionsStep) Sets the bridge implementing the value/index binding.<V2,F> void bridge(Class<V2> expectedValueType, ValueBridge<V2, F> bridge) Sets the bridge implementing the value/index binding.<V2,F> void bridge(Class<V2> expectedValueType, ValueBridge<V2, F> bridge, IndexFieldTypeOptionsStep<?, F> fieldTypeOptionsStep) Sets the bridge implementing the value/index binding.params()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.bridge.binding.BindingContext
beanResolver, param, param, paramOptional, paramOptional, params
-
Constructor Details
-
ValueBindingContextImpl
public ValueBindingContextImpl(BeanResolver beanResolver, PojoBootstrapIntrospector introspector, PojoTypeModel<V> valueTypeModel, boolean multiValued, IndexBindingContext indexBindingContext, IndexFieldTypeDefaultsProvider defaultsProvider, String relativeFieldName, FieldModelContributor contributor, Map<String, Object> params)
-
-
Method Details
-
bridge
Description copied from interface:ValueBindingContextSets the bridge implementing the value/index binding.- Specified by:
bridgein interfaceValueBindingContext<V>- Type Parameters:
V2- The type of values expected by the given bridge.F- The type of index field values, on the index side of the bridge.- Parameters:
expectedValueType- The type of values expected by the given bridge. Hibernate Search will check that these expectations are met, and throw an exception if they are not.bridge- The bridge to use at runtime to convert between the POJO property value and the index field value.
-
bridge
public <V2,F> void bridge(Class<V2> expectedValueType, ValueBridge<V2, F> bridge, IndexFieldTypeOptionsStep<?, F> fieldTypeOptionsStep) Description copied from interface:ValueBindingContextSets the bridge implementing the value/index binding.- Specified by:
bridgein interfaceValueBindingContext<V>- Type Parameters:
V2- The type of values expected by the given bridge.F- The type of index field values, on the index side of the bridge.- Parameters:
expectedValueType- The type of values expected by the given bridge. Hibernate Search will check that these expectations are met, and throw an exception if they are not.bridge- The bridge to use at runtime to convert between the POJO property value and the index field value.fieldTypeOptionsStep- The result of callingcontext.getTypeFactory()and setting the expectations regarding the index field type (for instancereturn context.getTypeFactory().asString()).nullto let Hibernate Search derive the expectations from theValueBridge's generic type parameters.Note the
DSL converterandprojection converterwill be ignored, since they are already implemented by the value bridge itself through itsValueBridge.toIndexedValue(Object, ValueBridgeToIndexedValueContext)andValueBridge.fromIndexedValue(Object, ValueBridgeFromIndexedValueContext)methods.
-
bridge
public <V2,F> void bridge(Class<V2> expectedValueType, BeanHolder<? extends ValueBridge<V2, F>> bridgeHolder, IndexFieldTypeOptionsStep<?, F> fieldTypeOptionsStep) Description copied from interface:ValueBindingContextSets the bridge implementing the value/index binding.- Specified by:
bridgein interfaceValueBindingContext<V>- Type Parameters:
V2- The type of values expected by the given bridge.F- The type of index field values, on the index side of the bridge.- Parameters:
expectedValueType- The type of values expected by the given bridge. Hibernate Search will check that these expectations are met, and throw an exception if they are not.bridgeHolder- ABeanHoldercontaining the bridge to use at runtime to convert between the POJO property value and the index field value. UseBeanHolder.of(Object)if you don't need any particular closing behavior.fieldTypeOptionsStep- The result of callingcontext.getTypeFactory()and setting the expectations regarding the index field type (for instancereturn context.getTypeFactory().asString()).nullto let Hibernate Search derive the expectations from theValueBridge's generic type parameters.Note the
DSL converterandprojection converterwill be ignored, since they are already implemented by the value bridge itself through itsValueBridge.toIndexedValue(Object, ValueBridgeToIndexedValueContext)andValueBridge.fromIndexedValue(Object, ValueBridgeFromIndexedValueContext)methods.
-
bridgedElement
- Specified by:
bridgedElementin interfaceValueBindingContext<V>- Returns:
- An entry point allowing to inspect the type of values that will be passed to this bridge.
-
typeFactory
- Specified by:
typeFactoryin interfaceValueBindingContext<V>- Returns:
- An entry point allowing to define a new field type.
-
applyBinder
-
beanResolver
- Specified by:
beanResolverin interfaceBindingContext- Returns:
- A bean provider, allowing the retrieval of beans, including CDI/Spring DI beans when in the appropriate environment.
-
params
- Specified by:
paramsin interfaceBindingContext- Returns:
- Parameters defined for the binder.
- See Also:
-