Add a convenience method to create a ValueCodeGenerator
This commit makes BeanDefinitionPropertyValueCodeGeneratorDelegates public and offer a convenience method to create a ValueCodeGenerator that works will all core delegates. Closes gh-34761
This commit is contained in:
@@ -22,6 +22,7 @@ import java.lang.reflect.Method;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -71,9 +72,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class BeanDefinitionPropertyValueCodeGeneratorDelegatesTests {
|
||||
|
||||
private static ValueCodeGenerator createValueCodeGenerator(GeneratedClass generatedClass) {
|
||||
return ValueCodeGenerator.with(BeanDefinitionPropertyValueCodeGeneratorDelegates.INSTANCES)
|
||||
.add(ValueCodeGeneratorDelegates.INSTANCES)
|
||||
.scoped(generatedClass.getMethods());
|
||||
return BeanDefinitionPropertyValueCodeGeneratorDelegates.createValueCodeGenerator(
|
||||
generatedClass.getMethods(), Collections.emptyList());
|
||||
}
|
||||
|
||||
private void compile(Object value, BiConsumer<Object, Compiled> result) {
|
||||
|
||||
Reference in New Issue
Block a user