public class EntityScanner extends Object
@EntityScan
specified packages.Constructor and Description |
---|
EntityScanner(ApplicationContext context)
Create a new
EntityScanner instance. |
Modifier and Type | Method and Description |
---|---|
protected ClassPathScanningCandidateComponentProvider |
createClassPathScanningCandidateComponentProvider(ApplicationContext context)
Create a
ClassPathScanningCandidateComponentProvider to scan entities based
on the specified ApplicationContext . |
Set<Class<?>> |
scan(Class<? extends Annotation>... annotationTypes)
Scan for entities with the specified annotations.
|
public EntityScanner(ApplicationContext context)
EntityScanner
instance.context
- the source application context@SafeVarargs public final Set<Class<?>> scan(Class<? extends Annotation>... annotationTypes) throws ClassNotFoundException
annotationTypes
- the annotation types used on the entitiesClassNotFoundException
- if an entity class cannot be loadedprotected ClassPathScanningCandidateComponentProvider createClassPathScanningCandidateComponentProvider(ApplicationContext context)
ClassPathScanningCandidateComponentProvider
to scan entities based
on the specified ApplicationContext
.context
- the ApplicationContext
to useClassPathScanningCandidateComponentProvider
suitable to scan
entities