BeanRegistrationCodeFragments implementation used by
default.
| Modifier and Type | Field and Description |
|---|---|
| private final BeanDefinitionMethodGeneratorFactory | |
| private final BeanRegistrationsCode | |
| private final Supplier | |
| private final RegisteredBean | |
| private static final ValueCodeGenerator |
| Access | Constructor and Description |
|---|---|
| pack-priv | DefaultBeanRegistrationCodeFragments(BeanRegistrationsCode beanRegistrationsCode, RegisteredBean registeredBean, BeanDefinitionMethodGeneratorFactory beanDefinitionMethodGeneratorFactory)
|
| Modifier and Type | Method and Description |
|---|---|
| private Class | |
| private Class | Returns: the target class to usethe factory bean type factoryBeanType, ResolvableType the bean type beanType)Extract the target class of a public |
| private CodeBlock | |
| private CodeBlock | |
| 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. |
| public CodeBlock | generateNewBeanDefinitionCode(GenerationContext
the generation context generationContext, ResolvableType the bean type beanType, BeanRegistrationCode the bean registration code beanRegistrationCode)Implements org. |
| public CodeBlock | generateReturnCode(GenerationContext
the generation context generationContext, BeanRegistrationCode the bean registration code beanRegistrationCode)Implements org. |
| 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. |
| 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. |
| protected CodeBlock | |
| private RegisteredBean | |
| public ClassName | getTarget(RegisteredBean
the registered bean registeredBean)Implements org. |
| private boolean | |
| private boolean |
| beanDefinitionMethodGeneratorFactory | back to summary |
|---|---|
| private final BeanDefinitionMethodGeneratorFactory beanDefinitionMethodGeneratorFactory | |
| beanRegistrationsCode | back to summary |
|---|---|
| private final BeanRegistrationsCode beanRegistrationsCode | |
| constructorOrFactoryMethod | back to summary |
|---|---|
| private final Supplier<Executable> constructorOrFactoryMethod | |
| registeredBean | back to summary |
|---|---|
| private final RegisteredBean registeredBean | |
| valueCodeGenerator | back to summary |
|---|---|
| private static final ValueCodeGenerator valueCodeGenerator | |
| DefaultBeanRegistrationCodeFragments | back to summary |
|---|---|
| pack-priv DefaultBeanRegistrationCodeFragments(BeanRegistrationsCode beanRegistrationsCode, RegisteredBean registeredBean, BeanDefinitionMethodGeneratorFactory beanDefinitionMethodGeneratorFactory) | |
| extractDeclaringClass | back to summary |
|---|---|
| private Class | |
| extractTargetClassFromFactoryBean | back to summary |
|---|---|
| private Class Extract the target class of a public
| |
| generateBeanClassCode | back to summary |
|---|---|
| private CodeBlock generateBeanClassCode(String targetPackage, Class<?> beanClass) | |
| generateBeanTypeCode | back to summary |
|---|---|
| private CodeBlock generateBeanTypeCode(ResolvableType beanType) | |
| 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
| |
| generateValueCode | back to summary |
|---|---|
protected CodeBlock generateValueCode(GenerationContext generationContext, String name, Object value)
| |
| getInnerRegisteredBean | back to summary |
|---|---|
private RegisteredBean getInnerRegisteredBean(Object value)
| |
| 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.
| |
| hasInstanceSupplier | back to summary |
|---|---|
| private boolean hasInstanceSupplier() | |
| targetTypeNecessary | back to summary |
|---|---|
| private boolean targetTypeNecessary(ResolvableType beanType, Class<?> beanClass) | |