Polishing
This commit is contained in:
@@ -36,13 +36,14 @@ import org.springframework.javapoet.ClassName;
|
||||
public class ApplicationContextAotGenerator {
|
||||
|
||||
/**
|
||||
* Process the specified {@link GenericApplicationContext} instance
|
||||
* ahead-of-time using the specified {@link GenerationContext}.
|
||||
* Process the specified {@link GenericApplicationContext} ahead-of-time using
|
||||
* the specified {@link GenerationContext}.
|
||||
* <p>Return the {@link ClassName} of the {@link ApplicationContextInitializer}
|
||||
* to use to restore an optimized state of the application context.
|
||||
* @param applicationContext the non-refreshed application context to handle
|
||||
* @param applicationContext the non-refreshed application context to process
|
||||
* @param generationContext the generation context to use
|
||||
* @return the class name of the {@link ApplicationContextInitializer} entry point
|
||||
* @return the {@code ClassName} of the {@code ApplicationContextInitializer}
|
||||
* entry point
|
||||
*/
|
||||
public ClassName processAheadOfTime(GenericApplicationContext applicationContext,
|
||||
GenerationContext generationContext) {
|
||||
|
||||
@@ -36,13 +36,12 @@ import org.springframework.javapoet.ParameterizedTypeName;
|
||||
import org.springframework.javapoet.TypeSpec;
|
||||
|
||||
/**
|
||||
* Internal code generator to create the application context initializer.
|
||||
* Internal code generator to create the {@link ApplicationContextInitializer}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 6.0
|
||||
*/
|
||||
class ApplicationContextInitializationCodeGenerator
|
||||
implements BeanFactoryInitializationCode {
|
||||
class ApplicationContextInitializationCodeGenerator implements BeanFactoryInitializationCode {
|
||||
|
||||
private static final String INITIALIZE_METHOD = "initialize";
|
||||
|
||||
@@ -70,13 +69,11 @@ class ApplicationContextInitializationCodeGenerator
|
||||
type.addMethod(generateInitializeMethod());
|
||||
}
|
||||
|
||||
|
||||
private MethodSpec generateInitializeMethod() {
|
||||
MethodSpec.Builder method = MethodSpec.methodBuilder(INITIALIZE_METHOD);
|
||||
method.addAnnotation(Override.class);
|
||||
method.addModifiers(Modifier.PUBLIC);
|
||||
method.addParameter(GenericApplicationContext.class,
|
||||
APPLICATION_CONTEXT_VARIABLE);
|
||||
method.addParameter(GenericApplicationContext.class, APPLICATION_CONTEXT_VARIABLE);
|
||||
method.addCode(generateInitializeCode());
|
||||
return method.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user