Package org.hibernate.search.bridge

Examples of org.hibernate.search.bridge.FieldBridge


   * @param cb the class bridge annotation
   * @param clazz the {@code XClass} on which the annotation is defined on
   * @return Returns the specified {@code FieldBridge} instance
   */
  public static FieldBridge extractType(ClassBridge cb, XClass clazz) {
    FieldBridge bridge = null;

    if ( cb != null ) {
      Class<?> impl = cb.impl();
      if ( impl != null ) {
        try {
View Full Code Here


   * @return Returns the {@code SpatialFieldBridge} instance
   * @param latitudeField a {@link java.lang.String} object.
   * @param longitudeField a {@link java.lang.String} object.
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, XClass clazz, String latitudeField, String longitudeField) {
    FieldBridge bridge;
    try {
      bridge = buildSpatialBridge( spatial, latitudeField, longitudeField );
    }
    catch ( Exception e ) {
      throw LOG.unableToInstantiateSpatial( clazz.getName(), e );
View Full Code Here

   * @param spatial the {@code Spatial} annotation
   * @param member the {@code XMember} on which the annotation is defined on
   * @return Returns the {@code SpatialFieldBridge} instance
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, XMember member) {
    FieldBridge bridge;
    try {
      bridge = buildSpatialBridge( spatial, null, null );
    }
    catch ( Exception e ) {
      throw LOG.unableToInstantiateSpatial( member.getName(), e );
View Full Code Here

   * @return Returns the {@code SpatialFieldBridge} instance
   * @param latitudeField a {@link java.lang.String} object.
   * @param longitudeField a {@link java.lang.String} object.
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, String latitudeField, String longitudeField) {
    FieldBridge bridge = null;
    if ( spatial != null ) {
      if ( spatial.spatialMode() == SpatialMode.GRID ) {
        if ( latitudeField != null && longitudeField != null ) {
          bridge = new SpatialFieldBridgeByQuadTree( spatial.topQuadTreeLevel(), spatial.bottomQuadTreeLevel(), latitudeField, longitudeField );
        }
View Full Code Here

    return bridge;
  }

  public static FieldBridge guessType(Field field, NumericField numericField, XMember member, ReflectionManager reflectionManager) {
    FieldBridge bridge;
    org.hibernate.search.annotations.FieldBridge bridgeAnn;
    //@Field bridge has priority over @FieldBridge
    if ( field != null && void.class != field.bridge().impl() ) {
      bridgeAnn = field.bridge();
    }
View Full Code Here

    return bridge;
  }

  private static FieldBridge createTikaBridge(org.hibernate.search.annotations.TikaBridge annotation) {
    Class<?> tikaBridgeClass;
    FieldBridge tikaBridge;
    try {
      tikaBridgeClass = ClassLoaderHelper.classForName( TIKA_BRIDGE_NAME, BridgeFactory.class.getClassLoader() );
      tikaBridge = ClassLoaderHelper.instanceFromClass( FieldBridge.class, tikaBridgeClass, "Tika bridge" );
    }
    catch ( ClassNotFoundException e ) {
View Full Code Here

  private static FieldBridge doExtractType(
      org.hibernate.search.annotations.FieldBridge bridgeAnn,
      String appliedOnName,
      Class<?> appliedOnType) {
    assert bridgeAnn != null : "@FieldBridge instance cannot be null";
    FieldBridge bridge;
    Class impl = bridgeAnn.impl();
    if ( impl == void.class ) {
      throw LOG.noImplementationClassInFieldBridge( appliedOnName );
    }
    try {
View Full Code Here

   * @throws SearchException if the FieldBridge passed in is not an instance of a TwoWayFieldBridge.
   */
  public static TwoWayFieldBridge extractTwoWayType(org.hibernate.search.annotations.FieldBridge fieldBridge,
                            XClass appliedOnType,
                            ReflectionManager reflectionManager) {
    FieldBridge fb = extractType( fieldBridge, appliedOnType, reflectionManager );
    if ( fb instanceof TwoWayFieldBridge ) {
      return (TwoWayFieldBridge) fb;
    }
    else {
      throw LOG.fieldBridgeNotAnInstanceof( TwoWayFieldBridge.class.getSimpleName() );
View Full Code Here

   * @return FieldBridge
   */
  public static FieldBridge extractType(org.hibernate.search.annotations.FieldBridge fieldBridgeAnnotation,
                      XClass appliedOnType,
                      ReflectionManager reflectionManager) {
    FieldBridge bridge = null;

    if ( fieldBridgeAnnotation != null ) {
      bridge = doExtractType(
          fieldBridgeAnnotation,
          appliedOnType.getName(),
View Full Code Here

        if ( idAnnotation instanceof DocumentId ) {
          explicitDocumentId = true;
        }
        idKeywordName = prefix + attributeName;

        FieldBridge fieldBridge = BridgeFactory.guessType( null, numericFieldAnn, member, reflectionManager );
        if ( fieldBridge instanceof TwoWayFieldBridge ) {
          idBridge = (TwoWayFieldBridge) fieldBridge;
        }
        else {
          throw new SearchException(
View Full Code Here

TOP

Related Classes of org.hibernate.search.bridge.FieldBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.