Interface ValueBindingContext<V>

Type Parameters:
V - The type of values on the POJO side of the bridge.
All Superinterfaces:
BindingContext

public interface ValueBindingContext<V> extends BindingContext
The context provided to the ValueBinder.bind(ValueBindingContext) method.
  • Method Details

    • bridge

      <V2, F> void bridge(Class<V2> expectedValueType, ValueBridge<V2,F> bridge)
      Sets the bridge implementing the value/index binding.
      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

      <V2, F> void bridge(Class<V2> expectedValueType, ValueBridge<V2,F> bridge, IndexFieldTypeOptionsStep<?,F> fieldTypeOptionsStep)
      Sets the bridge implementing the value/index binding.
      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 calling context.getTypeFactory() and setting the expectations regarding the index field type (for instance return context.getTypeFactory().asString()). null to let Hibernate Search derive the expectations from the ValueBridge's generic type parameters.

      Note the DSL converter and projection converter will be ignored, since they are already implemented by the value bridge itself through its ValueBridge.toIndexedValue(Object, ValueBridgeToIndexedValueContext) and ValueBridge.fromIndexedValue(Object, ValueBridgeFromIndexedValueContext) methods.

    • bridge

      <V2, F> void bridge(Class<V2> expectedValueType, BeanHolder<? extends ValueBridge<V2,F>> bridgeHolder, IndexFieldTypeOptionsStep<?,F> fieldTypeOptionsStep)
      Sets the bridge implementing the value/index binding.
      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 - A BeanHolder containing the bridge to use at runtime to convert between the POJO property value and the index field value. Use BeanHolder.of(Object) if you don't need any particular closing behavior.
      fieldTypeOptionsStep - The result of calling context.getTypeFactory() and setting the expectations regarding the index field type (for instance return context.getTypeFactory().asString()). null to let Hibernate Search derive the expectations from the ValueBridge's generic type parameters.

      Note the DSL converter and projection converter will be ignored, since they are already implemented by the value bridge itself through its ValueBridge.toIndexedValue(Object, ValueBridgeToIndexedValueContext) and ValueBridge.fromIndexedValue(Object, ValueBridgeFromIndexedValueContext) methods.

    • bridgedElement

      @Incubating PojoModelValue<V> bridgedElement()
      Returns:
      An entry point allowing to inspect the type of values that will be passed to this bridge.
    • typeFactory

      IndexFieldTypeFactory typeFactory()
      Returns:
      An entry point allowing to define a new field type.