List of utility methods to do XML Attribute Set
void | setPropertyIfAttributePresent(BeanDefinitionBuilder builder, Element element, String attributeName) set Property If Attribute Present String attributeValue = element.getAttribute(attributeName); if (StringUtils.hasText(attributeValue)) { builder.addPropertyValue(Conventions.attributeNameToPropertyName(attributeName), new TypedStringValue(attributeValue)); |
void | setPropertyReference(BeanDefinitionBuilder builder, Element element, String attribute, String property) Configures a bean property reference with the value of the attribute of the given name if it is configured. Assert.notNull(builder, "BeanDefinitionBuilder must not be null!"); Assert.notNull(element, "Element must not be null!"); Assert.hasText(attribute, "Attribute name must not be null!"); Assert.hasText(property, "Property name must not be null!"); String value = element.getAttribute(attribute); if (StringUtils.hasText(value)) { builder.addPropertyReference(property, value); |