org.hibernate.search.bridge.spi

## Interface ConversionContext

- All Known Implementing Classes:
    ContextualExceptionBridgeHelper

      public interface ConversionContext

  Setting the context before invoking a conversion bridge will provide more helpful exceptions in case of errors. This is especially important as bridge implementations often need to make assumptions about the data formats and are user provided.
  Author:
    Sanne Grinovero (C) 2012 Red Hat Inc., Hardy Ferentschik

- - ### Property Summary

    All Methods Instance Methods Abstract Methods
    Type | Property and Description
    --- | ---
    `ConversionContext` | `pop` Pops the last pushed property from the stack.
    `ConversionContext` | `pushIdentifier` In case the next conversion fails, the error message will point to the document id of the currently indexed type.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldBridge` | `oneWayConversionContext(FieldBridge delegate)` Decorates a FieldBridge.
    `ConversionContext` | `popProperty()` Pops the last pushed property from the stack.
    `ConversionContext` | `pushIdentifierProperty()` In case the next conversion fails, the error message will point to the document id of the currently indexed type.
    `ConversionContext` | `pushProperty(String propertyName)` The context has an internal stack for graph navigation.
    `ConversionContext` | `setConvertedTypeId(IndexedTypeIdentifier type)` In case the next conversion fails, the error message will point to this type.
    `StringBridge` | `stringConversionContext(StringBridge delegate)` Decorates a StringBridge.
    `TwoWayFieldBridge` | `twoWayConversionContext(TwoWayFieldBridge delegate)` Decorates a TwoWayFieldBridge.

- - ### Property Detail

    - #### pushIdentifier

          ConversionContext pushIdentifierProperty

      In case the next conversion fails, the error message will point to the document id of the currently indexed type.

    - #### pop

          ConversionContext popProperty

      Pops the last pushed property from the stack. See `pushIdentifierProperty()` and `pushProperty(String)`}

  - ### Method Detail

    - #### oneWayConversionContext

          FieldBridge oneWayConversionContext(FieldBridge delegate)

      Decorates a FieldBridge.
      Parameters:
        `delegate` - set the bridge that shall be used by the decoration.
      Returns:
        a decorated FieldBridge which should be used instead of the original delegate.

    - #### twoWayConversionContext

          TwoWayFieldBridge twoWayConversionContext(TwoWayFieldBridge delegate)

      Decorates a TwoWayFieldBridge.
      Parameters:
        `delegate` - set the bridge that shall be used by the decoration.
      Returns:
        a decorated TwoWayFieldBridge which should be used instead of the original delegate.

    - #### stringConversionContext

          StringBridge stringConversionContext(StringBridge delegate)

      Decorates a StringBridge.
      Parameters:
        `delegate` - set the bridge that shall be used by the decoration.
      Returns:
        a decorated StringBridge which should be used instead of the original delegate.

    - #### setConvertedTypeId

          ConversionContext setConvertedTypeId(IndexedTypeIdentifier type)

      In case the next conversion fails, the error message will point to this type.
      Parameters:
        `type` - the type which is going to be converted
      Returns:
        this for method chaining.

    - #### pushIdentifierProperty

          ConversionContext pushIdentifierProperty()

      In case the next conversion fails, the error message will point to the document id of the currently indexed type.

    - #### pushProperty

          ConversionContext pushProperty(String propertyName)

      The context has an internal stack for graph navigation. Pushing a property on the stack will make sure we know on which path the failure occurred. All invocations to a push need to cleanup with a `popProperty()`, especially after exceptions.
      Parameters:
        `propertyName` - the name of the property which is being followed for embedded indexing
      Returns:
        this for method chaining.

    - #### popProperty

          ConversionContext popProperty()

      Pops the last pushed property from the stack. See `pushIdentifierProperty()` and `pushProperty(String)`}

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved