Package org.springframework.context.aot

# 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 Summary

Constructors
Constructor
Description
`ReflectiveProcessorAotContributionBuilder()`

## Method Summary

Modifier and Type
Method
Description
`org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution`
`build()`
`ReflectiveProcessorAotContributionBuilder`
`scan(ClassLoader classLoader, String... packageNames)`
Scan the given `packageNames` and their sub-packages for classes that uses `Reflective`.
`ReflectiveProcessorAotContributionBuilder`
`withClasses(Class<?>[] classes)`
Process the given classes by checking the ones that use `Reflective`.
`ReflectiveProcessorAotContributionBuilder`
`withClasses(Iterable<Class<?>> classes)`
Process the given classes by checking the ones that use `Reflective`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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

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