org.springframework.data.repository.config

## Class CustomRepositoryImplementationDetector

- java.lang.Object
- - org.springframework.data.repository.config.CustomRepositoryImplementationDetector

    public class CustomRepositoryImplementationDetector
    extends Object

Detects the custom implementation for a `Repository` instance. If configured with a `ImplementationDetectionConfiguration` at construction time, the necessary component scan is executed on first access, cached and its result is the filtered on every further implementation lookup according to the given `ImplementationDetectionConfiguration`. If none is given initially, every invocation to `#detectCustomImplementation(String, String, ImplementationDetectionConfiguration)` will issue a new component scan.

Author:
  Oliver Gierke, Mark Paluch, Christoph Strobl, Peter Rietzler, Jens Schauder, Mark Paluch

### Constructor Summary

Constructors
Constructor and Description
`CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader)` Creates a new `CustomRepositoryImplementationDetector` with the given `Environment` and `ResourceLoader`.
`CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader, ImplementationDetectionConfiguration configuration)` Creates a new `CustomRepositoryImplementationDetector` with the given `Environment`, `ResourceLoader` and `ImplementationDetectionConfiguration`.

### Method Summary

All Methods Instance Methods Concrete Methods
`Optional<AbstractBeanDefinition>` `detectCustomImplementation(ImplementationLookupConfiguration lookup)` Tries to detect a custom implementation for a repository bean by classpath scanning.

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

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

### Constructor Detail

#### CustomRepositoryImplementationDetector

    public CustomRepositoryImplementationDetector(Environment environment,
                                                  ResourceLoader resourceLoader,
                                                  ImplementationDetectionConfiguration configuration)

Creates a new `CustomRepositoryImplementationDetector` with the given `Environment`, `ResourceLoader` and `ImplementationDetectionConfiguration`. The latter will be registered for a one-time component scan for implementation candidates that will the be used and filtered in all subsequent calls to `#detectCustomImplementation(RepositoryConfiguration)`.

Parameters:
  `environment` - must not be null.
  `resourceLoader` - must not be null.
  `configuration` - must not be null.

#### CustomRepositoryImplementationDetector

    public CustomRepositoryImplementationDetector(Environment environment,
                                                  ResourceLoader resourceLoader)

Creates a new `CustomRepositoryImplementationDetector` with the given `Environment` and `ResourceLoader`. Calls to `detectCustomImplementation(ImplementationLookupConfiguration)` will issue scans for

Parameters:
  `environment` - must not be null.
  `resourceLoader` - must not be null.

### Method Detail

#### detectCustomImplementation

    public Optional<AbstractBeanDefinition> detectCustomImplementation(ImplementationLookupConfiguration lookup)

Tries to detect a custom implementation for a repository bean by classpath scanning.

Parameters:
  `lookup` - must not be null.
Returns:
  the `AbstractBeanDefinition` of the custom implementation or null if none found.