Class ValueBindingContextImpl<V>
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.bridge.binding.impl.ValueBindingContextImpl<V>
-
- All Implemented Interfaces:
BindingContext,ValueBindingContext<V>
public class ValueBindingContextImpl<V> extends Object implements ValueBindingContext<V>
-
-
Constructor Summary
Constructors Constructor Description ValueBindingContextImpl(BeanResolver beanResolver, PojoBootstrapIntrospector introspector, PojoTypeModel<V> valueTypeModel, boolean multiValued, IndexBindingContext indexBindingContext, IndexFieldTypeDefaultsProvider defaultsProvider, String relativeFieldName, FieldModelContributor contributor, Map<String,Object> params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<BoundValueBridge<V,?>>applyBinder(ValueBinder binder)BeanResolverbeanResolver()<V2,F>
voidbridge(Class<V2> expectedValueType, BeanHolder<? extends ValueBridge<V2,F>> bridgeHolder, IndexFieldTypeOptionsStep<?,F> fieldTypeOptionsStep)Sets the bridge implementing the value/index binding.<V2,F>
voidbridge(Class<V2> expectedValueType, ValueBridge<V2,F> bridge)Sets the bridge implementing the value/index binding.<V2,F>
voidbridge(Class<V2> expectedValueType, ValueBridge<V2,F> bridge, IndexFieldTypeOptionsStep<?,F> fieldTypeOptionsStep)Sets the bridge implementing the value/index binding.PojoModelValue<V>bridgedElement()Objectparam(String name)Optional<Object>paramOptional(String name)IndexFieldTypeFactorytypeFactory()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.mapper.pojo.bridge.binding.BindingContext
beanResolver, param, paramOptional
-
-
-
-
Constructor Detail
-
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 Detail
-
bridge
public <V2,F> void bridge(Class<V2> expectedValueType, ValueBridge<V2,F> 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
public PojoModelValue<V> 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
public IndexFieldTypeFactory typeFactory()
- Specified by:
typeFactoryin interfaceValueBindingContext<V>- Returns:
- An entry point allowing to define a new field type.
-
applyBinder
public Optional<BoundValueBridge<V,?>> applyBinder(ValueBinder binder)
-
beanResolver
public BeanResolver beanResolver()
- Specified by:
beanResolverin interfaceBindingContext- Returns:
- A bean provider, allowing the retrieval of beans, including CDI/Spring DI beans when in the appropriate environment.
-
param
public Object param(String name)
- Specified by:
paramin interfaceBindingContext- Parameters:
name- The name of the param- Returns:
- Get a param defined for the binder by the given name
-
paramOptional
public Optional<Object> paramOptional(String name)
- Specified by:
paramOptionalin interfaceBindingContext- Parameters:
name- The name of the param- Returns:
- Get an optional param defined for the binder by the given name, a param having such name may either exist or not.
-
-