org.hibernate.search.bridge.impl

## Class BridgeFactory

- java.lang.Object
- - org.hibernate.search.bridge.impl.BridgeFactory

-     public final class BridgeFactory
      extends Object

  This factory is responsible for creating and initializing build-in and custom `FieldBridge`s.
  Author:
    Emmanuel Bernard, John Griffin

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BridgeFactory(ServiceManager serviceManager)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldBridge` | `buildFieldBridge(Field field, org.hibernate.annotations.common.reflection.XMember member, boolean isId, boolean isExplicitlyMarkedAsNumeric, IndexManagerType indexManagerType, org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager, ServiceManager serviceManager)`
    `FieldBridge` | `buildFieldBridge(org.hibernate.annotations.common.reflection.XMember member, boolean isId, boolean isExplicitlyMarkedAsNumeric, IndexManagerType indexManagerType, org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager, ServiceManager serviceManager)`
    `FieldBridge` | `buildSpatialBridge(Spatial spatial, Class<?> clazz, String latitudeField, String longitudeField)` This instantiates the SpatialFieldBridge from a `Spatial` annotation.
    `TwoWayFieldBridge` | `extractTwoWayType(FieldBridge fieldBridge, org.hibernate.annotations.common.reflection.XClass appliedOnType, org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager)` Takes in a fieldBridge and will return you a TwoWayFieldBridge instance.
    `FieldBridge` | `extractType(ClassBridge cb, Class<?> clazz)` This extracts and instantiates the implementation class from a `ClassBridge` annotation.
    `void` | `injectParameters(ClassBridge classBridgeConfiguration, Object classBridge)` Injects any parameters configured via the given `ClassBridge` annotation into the given object, in case this is a `ParameterizedBridge`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BridgeFactory

          public BridgeFactory(ServiceManager serviceManager)

  - ### Method Detail

    - #### extractType

          public FieldBridge extractType(ClassBridge cb,
                                         Class<?> clazz)

      This extracts and instantiates the implementation class from a `ClassBridge` annotation.
      Parameters:
        `cb` - the class bridge annotation
        `clazz` - the `Class` on which the annotation is defined on
      Returns:
        Returns the specified `FieldBridge` instance

    - #### injectParameters

          public void injectParameters(ClassBridge classBridgeConfiguration,
                                       Object classBridge)

      Injects any parameters configured via the given `ClassBridge` annotation into the given object, in case this is a `ParameterizedBridge`.
      Parameters:
        `classBridgeConfiguration` - the parameter source
        `classBridge` - the object to inject the parameters into

    - #### buildSpatialBridge

          public FieldBridge buildSpatialBridge(Spatial spatial,
                                                Class<?> clazz,
                                                String latitudeField,
                                                String longitudeField)

      This instantiates the SpatialFieldBridge from a `Spatial` annotation.
      Parameters:
        `spatial` - the `Spatial` annotation
        `clazz` - the class on which the annotation is defined
        `latitudeField` - a `String` object.
        `longitudeField` - a `String` object.
      Returns:
        Returns the `SpatialFieldBridge` instance

    - #### buildFieldBridge

          public FieldBridge buildFieldBridge(org.hibernate.annotations.common.reflection.XMember member,
                                              boolean isId,
                                              boolean isExplicitlyMarkedAsNumeric,
                                              IndexManagerType indexManagerType,
                                              org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager,
                                              ServiceManager serviceManager)

    - #### buildFieldBridge

          public FieldBridge buildFieldBridge(Field field,
                                              org.hibernate.annotations.common.reflection.XMember member,
                                              boolean isId,
                                              boolean isExplicitlyMarkedAsNumeric,
                                              IndexManagerType indexManagerType,
                                              org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager,
                                              ServiceManager serviceManager)

    - #### extractTwoWayType

          public TwoWayFieldBridge extractTwoWayType(FieldBridge fieldBridge,
                                                     org.hibernate.annotations.common.reflection.XClass appliedOnType,
                                                     org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager)

      Takes in a fieldBridge and will return you a TwoWayFieldBridge instance.
      Parameters:
        `fieldBridge` - the field bridge annotation
        `appliedOnType` - the type the bridge is applied on
        `reflectionManager` - The reflection manager instance
      Returns:
        a TwoWayFieldBridge instance if the Field Bridge is an instance of a TwoWayFieldBridge.
      Throws:
        `SearchException` - if the FieldBridge passed in is not an instance of a TwoWayFieldBridge.

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