Package org.springframework.context.aot
Class ReflectiveProcessorAotContributionBuilder
java.lang.Object
org.springframework.context.aot.ReflectiveProcessorAotContributionBuilder
Builder for an AOT
contribution that detects the presence of
@Reflective
on
annotated elements and invoke the underlying ReflectiveProcessor
implementations.
Candidates can be provided explicitly or by scanning the classpath.
- Since:
- 6.2
- Author:
- Stephane Nicoll
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
scan
(ClassLoader classLoader, String... packageNames) Scan the givenpackageNames
and their sub-packages for classes that usesReflective
.withClasses
(Class<?>[] classes) Process the given classes by checking the ones that useReflective
.withClasses
(Iterable<Class<?>> classes) Process the given classes by checking the ones that useReflective
.
-
Constructor Details
-
ReflectiveProcessorAotContributionBuilder
public ReflectiveProcessorAotContributionBuilder()
-
-
Method Details
-
withClasses
Process the given classes by checking the ones that useReflective
.A class is candidate if it uses
Reflective
directly or via a meta-annotation. Type, fields, constructors, methods and enclosed types are inspected.- Parameters:
classes
- the classes to inspect
-
withClasses
Process the given classes by checking the ones that useReflective
.A class is candidate if it uses
Reflective
directly or via a meta-annotation. Type, fields, constructors, methods and enclosed types are inspected.- Parameters:
classes
- the classes to inspect
-
scan
public ReflectiveProcessorAotContributionBuilder scan(@Nullable ClassLoader classLoader, String... packageNames) Scan the givenpackageNames
and their sub-packages for classes that usesReflective
.This performs a "deep scan" by loading every class in the specified packages and search for
Reflective
on types, constructors, methods, and fields. Enclosed classes are candidates as well. Classes that fail to load are ignored.- Parameters:
classLoader
- the classloader to usepackageNames
- the package names to scan
-
build
-