Class BeanParameterGenerator
java.lang.Object
org.springframework.beans.factory.generator.BeanParameterGenerator
Support for generating parameters.
- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BeanParameterGenerator
A default instance that does not handle inner bean definitions. -
Constructor Summary
ConstructorDescriptionCreate an instance with no support for inner bean definitions.BeanParameterGenerator
(Function<BeanDefinition, org.springframework.javapoet.CodeBlock> innerBeanDefinitionGenerator) Create an instance with the callback to use to generate an inner bean definition. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.javapoet.CodeBlock
generateExecutableParameterTypes
(Executable executable) Generate the parameter types of the specifiedExecutable
.org.springframework.javapoet.CodeBlock
generateParameterValue
(Object value) Generate the specified parametervalue
.org.springframework.javapoet.CodeBlock
generateParameterValue
(Object value, Supplier<ResolvableType> parameterType) Generate the specified parametervalue
.
-
Field Details
-
INSTANCE
A default instance that does not handle inner bean definitions.
-
-
Constructor Details
-
BeanParameterGenerator
public BeanParameterGenerator(Function<BeanDefinition, org.springframework.javapoet.CodeBlock> innerBeanDefinitionGenerator) Create an instance with the callback to use to generate an inner bean definition.- Parameters:
innerBeanDefinitionGenerator
- the inner bean definition generator
-
BeanParameterGenerator
public BeanParameterGenerator()Create an instance with no support for inner bean definitions.
-
-
Method Details
-
generateParameterValue
Generate the specified parametervalue
.- Parameters:
value
- the value of the parameter- Returns:
- the value of the parameter
-
generateParameterValue
public org.springframework.javapoet.CodeBlock generateParameterValue(@Nullable Object value, Supplier<ResolvableType> parameterType) Generate the specified parametervalue
.- Parameters:
value
- the value of the parameterparameterType
- the type of the parameter- Returns:
- the value of the parameter
-
generateExecutableParameterTypes
public org.springframework.javapoet.CodeBlock generateExecutableParameterTypes(Executable executable) Generate the parameter types of the specifiedExecutable
.- Parameters:
executable
- the executable- Returns:
- the parameter types of the executable as a comma separated list
-