Class ReflectiveProcessorAotContributionBuilder

java.lang.Object
org.springframework.context.aot.ReflectiveProcessorAotContributionBuilder

public class ReflectiveProcessorAotContributionBuilder extends Object
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:
  • Reflective
  • RegisterReflection
  • Constructor Details

    • ReflectiveProcessorAotContributionBuilder

      public ReflectiveProcessorAotContributionBuilder()
  • Method Details

    • withClasses

      public ReflectiveProcessorAotContributionBuilder withClasses(Iterable<Class<?>> classes)
      Process the given classes by checking the ones that use Reflective.

      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

      public ReflectiveProcessorAotContributionBuilder withClasses(Class<?>[] classes)
      Process the given classes by checking the ones that use Reflective.

      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 given packageNames and their sub-packages for classes that uses Reflective.

      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 use
      packageNames - the package names to scan
    • build

      public @Nullable org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution build()