Class EntityScanner
java.lang.Object
org.springframework.boot.autoconfigure.domain.EntityScanner
An entity scanner that searches the classpath from an
@EntityScan
specified packages.- Since:
- 1.4.0
- Author:
- Phillip Webb
-
Constructor Summary
ConstructorDescriptionEntityScanner
(ApplicationContext context) Create a newEntityScanner
instance. -
Method Summary
Modifier and TypeMethodDescriptionCreate aClassPathScanningCandidateComponentProvider
to scan entities based on the specifiedApplicationContext
.scan
(Class<? extends Annotation>... annotationTypes) Scan for entities with the specified annotations.
-
Constructor Details
-
EntityScanner
Create a newEntityScanner
instance.- Parameters:
context
- the source application context
-
-
Method Details
-
scan
@SafeVarargs public final Set<Class<?>> scan(Class<? extends Annotation>... annotationTypes) throws ClassNotFoundException Scan for entities with the specified annotations.- Parameters:
annotationTypes
- the annotation types used on the entities- Returns:
- a set of entity classes
- Throws:
ClassNotFoundException
- if an entity class cannot be loaded
-
createClassPathScanningCandidateComponentProvider
protected ClassPathScanningCandidateComponentProvider createClassPathScanningCandidateComponentProvider(ApplicationContext context) Create aClassPathScanningCandidateComponentProvider
to scan entities based on the specifiedApplicationContext
.- Parameters:
context
- theApplicationContext
to use- Returns:
- a
ClassPathScanningCandidateComponentProvider
suitable to scan entities - Since:
- 2.4.0
-