|
|
|
|
@ -33,6 +33,7 @@ import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
|
|
|
|
import org.springframework.beans.factory.aot.BeanRegistrationCode; |
|
|
|
|
import org.springframework.beans.factory.aot.BeanRegistrationCodeFragments; |
|
|
|
|
import org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator; |
|
|
|
|
import org.springframework.beans.factory.aot.CodeWarnings; |
|
|
|
|
import org.springframework.beans.factory.support.RegisteredBean; |
|
|
|
|
import org.springframework.javapoet.ClassName; |
|
|
|
|
import org.springframework.javapoet.CodeBlock; |
|
|
|
|
@ -87,9 +88,15 @@ class JsonMixinModuleEntriesBeanRegistrationAotProcessor implements BeanRegistra
@@ -87,9 +88,15 @@ class JsonMixinModuleEntriesBeanRegistrationAotProcessor implements BeanRegistra
|
|
|
|
|
method.addModifiers(Modifier.PRIVATE, Modifier.STATIC); |
|
|
|
|
method.returns(BEAN_TYPE); |
|
|
|
|
CodeBlock.Builder code = CodeBlock.builder(); |
|
|
|
|
code.add("return $T.create(", JsonMixinModuleEntries.class).beginControlFlow("(mixins) ->"); |
|
|
|
|
entries.doWithEntry(this.classLoader, (type, mixin) -> addEntryCode(code, type, mixin)); |
|
|
|
|
CodeWarnings codeWarnings = new CodeWarnings(); |
|
|
|
|
codeWarnings.detectDeprecation(BEAN_TYPE); |
|
|
|
|
code.add("return $T.create(", BEAN_TYPE).beginControlFlow("(mixins) ->"); |
|
|
|
|
entries.doWithEntry(this.classLoader, (type, mixin) -> { |
|
|
|
|
codeWarnings.detectDeprecation(type, mixin); |
|
|
|
|
addEntryCode(code, type, mixin); |
|
|
|
|
}); |
|
|
|
|
code.endControlFlow(")"); |
|
|
|
|
codeWarnings.suppress(method); |
|
|
|
|
method.addCode(code.build()); |
|
|
|
|
}); |
|
|
|
|
return generatedMethod.toMethodReference().toCodeBlock(); |
|
|
|
|
|