Generate matching structure for configuration classes

This commit improves GeneratedClass to support inner classes, allowing
them to be registered by name with a type customizer, as
GeneratedClasses does for top level classes.

BeanDefinitionMethodGenerator leverages this feature to create a
matching structure for configuration classes that contain inner classes.

Closes gh-29213
This commit is contained in:
Stephane Nicoll
2022-09-28 08:55:27 +02:00
parent b1ee44f12e
commit 38d91bafce
6 changed files with 230 additions and 18 deletions

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.testfixture.beans.factory.aot;
/**
* A configuration with inner classes.
*
* @author Stephane Nicoll
*/
public class InnerBeanConfiguration {
public static class Simple {
public SimpleBean simpleBean() {
return new SimpleBean();
}
public static class Another {
public SimpleBean anotherBean() {
return new SimpleBean();
}
}
}
}

View File

@@ -17,6 +17,7 @@
package org.springframework.beans.testfixture.beans.factory.aot;
/**
* A sample configuration.
*
* @author Stephane Nicoll
*/