Here you can find the source of setPropertyIfAttributePresent( BeanDefinitionBuilder builder, Element element, String attributeName)
public static void setPropertyIfAttributePresent( BeanDefinitionBuilder builder, Element element, String attributeName)
//package com.java2s; //License from project: Apache License import org.springframework.beans.factory.config.TypedStringValue; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.core.Conventions; import org.springframework.util.StringUtils; import org.w3c.dom.Element; public class Main { public static void setPropertyIfAttributePresent( BeanDefinitionBuilder builder, Element element, String attributeName) { String attributeValue = element.getAttribute(attributeName); if (StringUtils.hasText(attributeValue)) { builder.addPropertyValue(/*from ww w .j a va 2 s . c o m*/ Conventions.attributeNameToPropertyName(attributeName), new TypedStringValue(attributeValue)); } } }