BeanRegistrationCodeFragments decorator implementation. Typically
used when part of the default code fragments have to customized, by extending
this class and using it as part of
BeanRegistrationAotContribution#withCustomCodeFragments(UnaryOperator).
| Modifier and Type | Field and Description |
|---|---|
| private final BeanRegistrationCodeFragments |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public CodeBlock | generateInstanceSupplierCode(GenerationContext
the generation context generationContext, BeanRegistrationCode the bean registration code beanRegistrationCode, boolean if direct suppliers may be used rather
than always needing an allowDirectSupplierShortcut)InstanceSupplierImplements org. Generate the instance supplier code. |
| public CodeBlock | generateNewBeanDefinitionCode(GenerationContext
the generation context generationContext, ResolvableType the bean type beanType, BeanRegistrationCode the bean registration code beanRegistrationCode)Implements org. Generate the code that defines the new bean definition instance. |
| public CodeBlock | generateReturnCode(GenerationContext
the generation context generationContext, BeanRegistrationCode the bean registration code beanRegistrationCode)Implements org. Generate the return statement. |
| public CodeBlock | generateSetBeanDefinitionPropertiesCode(GenerationContext
the generation context generationContext, BeanRegistrationCode the bean registration code beanRegistrationCode, RootBeanDefinition beanDefinition, Predicate<String> any attribute filtering that should be applied attributeFilter)Implements org. Generate the code that sets the properties of the bean definition. |
| public CodeBlock | generateSetBeanInstanceSupplierCode(GenerationContext
the generation context generationContext, BeanRegistrationCode the bean registration code beanRegistrationCode, CodeBlock the instance supplier code supplier code instanceSupplierCode, List<MethodReference> any instance post processors that should be applied postProcessors)Implements org. Generate the code that sets the instance supplier on the bean definition. |
| public ClassName | getTarget(RegisteredBean
the registered bean registeredBean)Implements org. Return the target for the registration. |
| delegate | back to summary |
|---|---|
| private final BeanRegistrationCodeFragments delegate | |
| BeanRegistrationCodeFragmentsDecorator | back to summary |
|---|---|
| protected BeanRegistrationCodeFragmentsDecorator(BeanRegistrationCodeFragments delegate) | |
| generateInstanceSupplierCode | back to summary |
|---|---|
| public CodeBlock generateInstanceSupplierCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode, boolean allowDirectSupplierShortcut) Implements org. Doc from org. Generate the instance supplier code.
| |
| generateNewBeanDefinitionCode | back to summary |
|---|---|
| public CodeBlock generateNewBeanDefinitionCode(GenerationContext generationContext, ResolvableType beanType, BeanRegistrationCode beanRegistrationCode) Implements org. Doc from org. Generate the code that defines the new bean definition instance. This should declare a variable named beanDefinition so that further fragments can refer to the variable to further tune the bean definition.
| |
| generateReturnCode | back to summary |
|---|---|
| public CodeBlock generateReturnCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) Implements org. Doc from org. Generate the return statement.
| |
| generateSetBeanDefinitionPropertiesCode | back to summary |
|---|---|
| public CodeBlock generateSetBeanDefinitionPropertiesCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode, RootBeanDefinition beanDefinition, Predicate<String> attributeFilter) Implements org. Generate the code that sets the properties of the bean definition.
| |
| generateSetBeanInstanceSupplierCode | back to summary |
|---|---|
| public CodeBlock generateSetBeanInstanceSupplierCode(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode, CodeBlock instanceSupplierCode, List<MethodReference> postProcessors) Implements org. Generate the code that sets the instance supplier on the bean definition.
The
| |
| getTarget | back to summary |
|---|---|
| public ClassName getTarget(RegisteredBean registeredBean) Implements org. Doc from org. Return the target for the registration. Used to determine where to write the code. This should take into account visibility issue, such as package access of an element of the bean to register.
| |