Class BeanParameterGenerator

java.lang.Object
org.springframework.beans.factory.generator.BeanParameterGenerator

public final class BeanParameterGenerator extends Object
Support for generating parameters.
Since:
6.0
Author:
Stephane Nicoll
  • Field Details

    • INSTANCE

      public static final BeanParameterGenerator 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

      public org.springframework.javapoet.CodeBlock generateParameterValue(@Nullable Object value)
      Generate the specified parameter value.
      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 parameter value.
      Parameters:
      value - the value of the parameter
      parameterType - 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 specified Executable.
      Parameters:
      executable - the executable
      Returns:
      the parameter types of the executable as a comma separated list