1
1
/*
2
- * Copyright 2002-2021 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
25
25
import java .util .Set ;
26
26
27
27
import org .springframework .beans .BeanWrapper ;
28
+ import org .springframework .beans .BeanWrapperImpl ;
28
29
import org .springframework .beans .BeansException ;
29
30
import org .springframework .beans .TypeConverter ;
30
31
import org .springframework .beans .factory .BeanCreationException ;
59
60
* @since 1.2
60
61
* @see AbstractAutowireCapableBeanFactory
61
62
*/
62
- class BeanDefinitionValueResolver {
63
+ public class BeanDefinitionValueResolver {
63
64
64
65
private final AbstractAutowireCapableBeanFactory beanFactory ;
65
66
@@ -71,7 +72,8 @@ class BeanDefinitionValueResolver {
71
72
72
73
73
74
/**
74
- * Create a BeanDefinitionValueResolver for the given BeanFactory and BeanDefinition.
75
+ * Create a BeanDefinitionValueResolver for the given BeanFactory and BeanDefinition,
76
+ * using the given {@link TypeConverter}.
75
77
* @param beanFactory the BeanFactory to resolve against
76
78
* @param beanName the name of the bean that we work on
77
79
* @param beanDefinition the BeanDefinition of the bean that we work on
@@ -86,6 +88,24 @@ public BeanDefinitionValueResolver(AbstractAutowireCapableBeanFactory beanFactor
86
88
this .typeConverter = typeConverter ;
87
89
}
88
90
91
+ /**
92
+ * Create a BeanDefinitionValueResolver for the given BeanFactory and BeanDefinition
93
+ * using a default {@link TypeConverter}.
94
+ * @param beanFactory the BeanFactory to resolve against
95
+ * @param beanName the name of the bean that we work on
96
+ * @param beanDefinition the BeanDefinition of the bean that we work on
97
+ */
98
+ public BeanDefinitionValueResolver (AbstractAutowireCapableBeanFactory beanFactory , String beanName ,
99
+ BeanDefinition beanDefinition ) {
100
+
101
+ this .beanFactory = beanFactory ;
102
+ this .beanName = beanName ;
103
+ this .beanDefinition = beanDefinition ;
104
+ BeanWrapper beanWrapper = new BeanWrapperImpl ();
105
+ beanFactory .initBeanWrapper (beanWrapper );
106
+ this .typeConverter = beanWrapper ;
107
+ }
108
+
89
109
90
110
/**
91
111
* Given a PropertyValue, return a value, resolving any references to other
0 commit comments