Add `GeneratedMethods` and `GeneratedMethod` support classes which
can be used during code generation to generation additional methods
that will ultimately be included in a `JavaFile`.
See gh-28414
Add a `GeneratedFiles` interface that can be used to add generated
source, class and resource files. An in-memory implementation is
provided for testing and a filesystem implementation is provided
to actually save the files to disk.
See gh-28414
Add resolver utilities that can be used to perform programmatic
autowiring of fields, methods, constructors and factory methods.
The resolvers are designed to work in an AOT environment and
allows the actual injection to be performed using functional
interfaces. This allows leaner images to be created since
`introspection` hints are required rather than full `invocation`
hints.
The resolvers also provide a reflection based fallback that can
used when the functional interface cannot work. For example, a
reflection based solution is required for private fields, methods
and constructors.
See gh-28414
Add a new `InstanceSupplier` interface that can be used as an
alternative to a regular bean `Supplier` when details about the
bean being supplied are required to instantiate it. The new
interface accepts a `RegisteredBean` instance which provides
access to the bean name, the bean factory creating the bean
and the bean definition.
This interface is primarily designed to allow AOT generated code
to autowire dependencies into the instance.
See gh-28414
Update the `TestCompiler` so that classes can be defined using
a `Lookup`. This update allows package-private classes to be
accessed without needing a quite so unusual classloader setup.
The `@CompileWithTargetClassAccess` should be added to any
test that needs to use `Lookup` based defines. The test will
run with a completed forked classloader so not to pollute the
main classloader.
This commit also adds some useful additional APIs.
See gh-28120
Add 'Throwable' variants of the `Consumer`, `Function`, `BiFunction` and
`Supplier` interfaces that wrap checked exceptions or allow calls to be
made that throw them.
Closes gh-28417
Update `SpringFactoriesLoader` so that it can load files from
arbitrary locations. An instance of the loader class itself is now
returned from static factory methods that accept different
locations.
The recent `ArgumentResolver` and `FailureHandler` `loadFactories`
variants are now no longer available as static methods. They are
still available as instance methods.
The `loadFactories` static method remains to provide
back-compatibility with Spring Framework 5.x
See gh-28416