Class BridgeFactory

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

public final class BridgeFactory extends Object
This factory is responsible for creating and initializing build-in and custom FieldBridges.
  • Field Details

  • Method Details

    • extractType

      public static FieldBridge extractType(ClassBridge cb, XClass clazz)
      This extracts and instantiates the implementation class from a ClassBridge annotation.
      Parameters:
      cb - the class bridge annotation
      clazz - the XClass on which the annotation is defined on
      Returns:
      Returns the specified FieldBridge instance
    • guessType

      public static FieldBridge guessType(Field field, NumericField numericField, XMember member, ReflectionManager reflectionManager)
    • getDateField

      public static FieldBridge getDateField(Resolution resolution)
    • getCalendarField

      public static FieldBridge getCalendarField(Resolution resolution)
    • extractTwoWayType

      public static TwoWayFieldBridge extractTwoWayType(FieldBridge fieldBridge, XClass appliedOnType, 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.
    • extractType

      public static FieldBridge extractType(FieldBridge fieldBridgeAnnotation, XClass appliedOnType, ReflectionManager reflectionManager)
      This extracts and instantiates the implementation class from a ClassBridge annotation.
      Parameters:
      fieldBridgeAnnotation - the FieldBridge annotation
      appliedOnType - the type the bridge is applied on
      reflectionManager - The reflection manager instance
      Returns:
      FieldBridge