|
10 | 10 | import java.util.function.Consumer; |
11 | 11 |
|
12 | 12 | import static org.springframework.core.Conventions.attributeNameToPropertyName; |
| 13 | +import static org.springframework.integration.config.xml.IntegrationNamespaceUtils.setReferenceIfAttributeDefined; |
13 | 14 | import static org.springframework.integration.config.xml.IntegrationNamespaceUtils.setValueIfAttributeDefined; |
14 | 15 |
|
15 | 16 | public class XmlBeanDefinitionBuilder { |
@@ -49,23 +50,33 @@ public XmlBeanDefinitionBuilder addConstructorArgValue(String attributeName) { |
49 | 50 | return this; |
50 | 51 | } |
51 | 52 |
|
52 | | - public XmlBeanDefinitionBuilder setPropertyValue(String attributeName) { |
53 | | - builder.addPropertyValue(attributeNameToPropertyName(attributeName), new TypedStringValue(element.getAttribute(attributeName))); |
| 53 | + public XmlBeanDefinitionBuilder setPropertyReference(String attributeName) { |
| 54 | + builder.addPropertyReference(attributeNameToPropertyName(attributeName), element.getAttribute(attributeName)); |
54 | 55 | return this; |
55 | 56 | } |
56 | 57 |
|
57 | | - public XmlBeanDefinitionBuilder setPropertyValue(String propertyName, String attributeName) { |
58 | | - builder.addPropertyValue(propertyName, new TypedStringValue(element.getAttribute(attributeName))); |
| 58 | + public XmlBeanDefinitionBuilder setPropertyReference(String propertyName, String attributeName) { |
| 59 | + builder.addPropertyReference(propertyName, element.getAttribute(attributeName)); |
59 | 60 | return this; |
60 | 61 | } |
61 | 62 |
|
62 | | - public XmlBeanDefinitionBuilder setPropertyReference(String attributeName) { |
63 | | - builder.addPropertyReference(attributeNameToPropertyName(attributeName), element.getAttribute(attributeName)); |
| 63 | + public XmlBeanDefinitionBuilder setPropertyReferenceIfAttributeDefined(String attributeName) { |
| 64 | + setReferenceIfAttributeDefined(builder, element, attributeName); |
64 | 65 | return this; |
65 | 66 | } |
66 | 67 |
|
67 | | - public XmlBeanDefinitionBuilder setPropertyReference(String propertyName, String attributeName) { |
68 | | - builder.addPropertyReference(propertyName, element.getAttribute(attributeName)); |
| 68 | + public XmlBeanDefinitionBuilder setPropertyReferenceIfAttributeDefined(String propertyName, String attributeName) { |
| 69 | + setReferenceIfAttributeDefined(builder, element, attributeName, propertyName); |
| 70 | + return this; |
| 71 | + } |
| 72 | + |
| 73 | + public XmlBeanDefinitionBuilder setPropertyValue(String attributeName) { |
| 74 | + builder.addPropertyValue(attributeNameToPropertyName(attributeName), new TypedStringValue(element.getAttribute(attributeName))); |
| 75 | + return this; |
| 76 | + } |
| 77 | + |
| 78 | + public XmlBeanDefinitionBuilder setPropertyValue(String propertyName, String attributeName) { |
| 79 | + builder.addPropertyValue(propertyName, new TypedStringValue(element.getAttribute(attributeName))); |
69 | 80 | return this; |
70 | 81 | } |
71 | 82 |
|
|
0 commit comments