All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.search.bridge.spi.BridgeProvider Maven / Gradle / Ivy

There is a newer version: 5.11.12.Final
Show newest version
/*
 * Hibernate Search, full-text search for your domain model
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or .
 */

package org.hibernate.search.bridge.spi;

import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.engine.service.spi.ServiceManager;

/**
 * Service interface to allow custom bridges to be auto discovered.
 *
 * Implementations of this interface must have a default constructor and a file named
 * {@code META-INF/services/org.hibernate.search.bridge.spi.BridgeProvider}
 * should contain the fully qualified class name of the bridge provider
 * implementation. When several implementations are present in a given JAR,
 * place one class name per line.
 * This follows the JDK service loader pattern.
 *
 * @author Emmanuel Bernard 
 */
public interface BridgeProvider {

	/**
	 * @return a {@link org.hibernate.search.bridge.FieldBridge} instance if the provider can
	 * build a bridge for the calling context. {@code null} otherwise.
	 */
	FieldBridge provideFieldBridge(BridgeProviderContext bridgeProviderContext);

	interface BridgeProviderContext {

		/**
		 * Returns the type of the indexed member/property.
		 *
		 * @return the type of the indexed member
		 */
		Class getReturnType();

		/**
		 * Provides access to the {@code ServiceManager} and gives access to
		 * Hibernate Search services like the {@code ClassLoaderService}.
		 *
		 * @return the Hibernate Search {@code ServiceManager}
		 */
		ServiceManager getServiceManager();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy