Package grails.boot.config
Class GrailsComponentScanner
- java.lang.Object
-
- grails.boot.config.GrailsComponentScanner
-
public class GrailsComponentScanner extends java.lang.ObjectA Grails classes scanner that searches the classpath from an@GrailsComponentScannerspecified packages.- Since:
- 2022.0.0
-
-
Constructor Summary
Constructors Constructor Description GrailsComponentScanner(org.springframework.context.ApplicationContext context)Create a newGrailsComponentScannerinstance.GrailsComponentScanner(org.springframework.context.ApplicationContext context, org.springframework.core.metrics.ApplicationStartup applicationStartup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.context.annotation.ClassPathScanningCandidateComponentProvidercreateClassPathScanningCandidateComponentProvider(org.springframework.context.ApplicationContext context)Create aClassPathScanningCandidateComponentProviderto scan entities based on the specifiedApplicationContext.java.util.List<java.lang.String>getPackages()java.util.Set<java.lang.Class<?>>scan(java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)Scan for entities with the specified annotations.
-
-
-
Constructor Detail
-
GrailsComponentScanner
public GrailsComponentScanner(org.springframework.context.ApplicationContext context)
Create a newGrailsComponentScannerinstance.- Parameters:
context- the source application context
-
GrailsComponentScanner
public GrailsComponentScanner(org.springframework.context.ApplicationContext context, org.springframework.core.metrics.ApplicationStartup applicationStartup)
-
-
Method Detail
-
scan
@SafeVarargs public final java.util.Set<java.lang.Class<?>> scan(java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes) throws java.lang.ClassNotFoundExceptionScan for entities with the specified annotations.- Parameters:
annotationTypes- the annotation types used on the artefacts- Returns:
- a set of artefact classes
- Throws:
java.lang.ClassNotFoundException- if an artefact class cannot be loaded
-
createClassPathScanningCandidateComponentProvider
protected org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider createClassPathScanningCandidateComponentProvider(org.springframework.context.ApplicationContext context)
Create aClassPathScanningCandidateComponentProviderto scan entities based on the specifiedApplicationContext.- Parameters:
context- theApplicationContextto use- Returns:
- a
ClassPathScanningCandidateComponentProvidersuitable to scan entities - Since:
- 2.4.0
-
getPackages
public java.util.List<java.lang.String> getPackages()
-
-