|
|
|
@ -78,6 +78,7 @@ import org.springframework.util.xml.DomUtils; |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Rod Johnson |
|
|
|
* @author Rod Johnson |
|
|
|
* @author Mark Fisher |
|
|
|
* @author Mark Fisher |
|
|
|
|
|
|
|
* @author Gary Russell |
|
|
|
* @since 2.0 |
|
|
|
* @since 2.0 |
|
|
|
* @see ParserContext |
|
|
|
* @see ParserContext |
|
|
|
* @see DefaultBeanDefinitionDocumentReader |
|
|
|
* @see DefaultBeanDefinitionDocumentReader |
|
|
|
@ -1302,13 +1303,24 @@ public class BeanDefinitionParserDelegate { |
|
|
|
Object value = null; |
|
|
|
Object value = null; |
|
|
|
boolean hasValueAttribute = entryEle.hasAttribute(VALUE_ATTRIBUTE); |
|
|
|
boolean hasValueAttribute = entryEle.hasAttribute(VALUE_ATTRIBUTE); |
|
|
|
boolean hasValueRefAttribute = entryEle.hasAttribute(VALUE_REF_ATTRIBUTE); |
|
|
|
boolean hasValueRefAttribute = entryEle.hasAttribute(VALUE_REF_ATTRIBUTE); |
|
|
|
|
|
|
|
boolean hasValueTypeAttribute = entryEle.hasAttribute(VALUE_TYPE_ATTRIBUTE); |
|
|
|
if ((hasValueAttribute && hasValueRefAttribute) || |
|
|
|
if ((hasValueAttribute && hasValueRefAttribute) || |
|
|
|
((hasValueAttribute || hasValueRefAttribute)) && valueEle != null) { |
|
|
|
((hasValueAttribute || hasValueRefAttribute)) && valueEle != null) { |
|
|
|
error("<entry> element is only allowed to contain either " + |
|
|
|
error("<entry> element is only allowed to contain either " + |
|
|
|
"'value' attribute OR 'value-ref' attribute OR <value> sub-element", entryEle); |
|
|
|
"'value' attribute OR 'value-ref' attribute OR <value> sub-element", entryEle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ((hasValueTypeAttribute && hasValueRefAttribute) || |
|
|
|
|
|
|
|
(hasValueTypeAttribute && !hasValueAttribute) || |
|
|
|
|
|
|
|
(hasValueTypeAttribute && valueEle != null)) { |
|
|
|
|
|
|
|
error("<entry> element is only allowed to contain a 'value-type' " + |
|
|
|
|
|
|
|
"attribute when it has a 'value' attribute", entryEle); |
|
|
|
|
|
|
|
} |
|
|
|
if (hasValueAttribute) { |
|
|
|
if (hasValueAttribute) { |
|
|
|
value = buildTypedStringValueForMap(entryEle.getAttribute(VALUE_ATTRIBUTE), defaultValueType, entryEle); |
|
|
|
String valueType = entryEle.getAttribute(VALUE_TYPE_ATTRIBUTE); |
|
|
|
|
|
|
|
if (!StringUtils.hasText(valueType)) { |
|
|
|
|
|
|
|
valueType = defaultValueType; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
value = buildTypedStringValueForMap(entryEle.getAttribute(VALUE_ATTRIBUTE), valueType, entryEle); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (hasValueRefAttribute) { |
|
|
|
else if (hasValueRefAttribute) { |
|
|
|
String refName = entryEle.getAttribute(VALUE_REF_ATTRIBUTE); |
|
|
|
String refName = entryEle.getAttribute(VALUE_REF_ATTRIBUTE); |
|
|
|
|