Class ValueCodeGenerator
java.lang.Object
org.springframework.aot.generate.ValueCodeGenerator
Code generator for a single value. Delegates code generation to a list of
configurable 
ValueCodeGenerator.Delegate implementations.- Since:
- 6.1.2
- Author:
- Stephane Nicoll
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceStrategy interface that can be used to implement code generation for a particular value type.
- 
Method SummaryModifier and TypeMethodDescriptionadd(List<ValueCodeGenerator.Delegate> additionalDelegates) org.springframework.javapoet.CodeBlockgenerateCode(@Nullable Object value) Generate the code that represents the specifiedvalue.Return theGeneratedMethodsthat represents the scope in which code generated by this instance will be added, ornullif no specific scope is set.scoped(GeneratedMethods generatedMethods) Return aValueCodeGeneratorthat is scoped for the specifiedGeneratedMethods.static ValueCodeGeneratorwith(List<ValueCodeGenerator.Delegate> delegates) Create an instance with the specifiedValueCodeGenerator.Delegateimplementations.static ValueCodeGeneratorwith(ValueCodeGenerator.Delegate... delegates) Create an instance with the specifiedValueCodeGenerator.Delegateimplementations.static ValueCodeGeneratorReturn an instance that provides support for common value types.
- 
Method Details- 
withDefaultsReturn an instance that provides support for common value types.- Returns:
- an instance with support for common value types
 
- 
withCreate an instance with the specifiedValueCodeGenerator.Delegateimplementations.- Parameters:
- delegates- the delegates to use
- Returns:
- an instance with the specified delegates
 
- 
withCreate an instance with the specifiedValueCodeGenerator.Delegateimplementations.- Parameters:
- delegates- the delegates to use
- Returns:
- an instance with the specified delegates
 
- 
add
- 
scopedReturn aValueCodeGeneratorthat is scoped for the specifiedGeneratedMethods. This allows code generation to generate additional methods if necessary, or perform some optimization in case of visibility issues.- Parameters:
- generatedMethods- the generated methods to use
- Returns:
- an instance scoped to the specified generated methods
 
- 
generateCode
- 
getGeneratedMethodsReturn theGeneratedMethodsthat represents the scope in which code generated by this instance will be added, ornullif no specific scope is set.- Returns:
- the generated methods to use for code generation
 
 
-