@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String location = element.getAttribute("location"); if (StringUtils.hasLength(location)) { location = parserContext.getReaderContext().getEnvironment().resolvePlaceholders(location); String[] locations = StringUtils.commaDelimitedListToStringArray(location); builder.addPropertyValue("locations", locations); } builder.addPropertyValue("ignoreResourceNotFound", Boolean.valueOf(element.getAttribute("ignore-resource-not-found"))); builder.addPropertyValue("localOverride", Boolean.valueOf(element.getAttribute("local-override"))); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } } }
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String location = element.getAttribute("location"); if (StringUtils.hasLength(location)) { location = parserContext.getReaderContext().getEnvironment().resolvePlaceholders(location); String[] locations = StringUtils.commaDelimitedListToStringArray(location); builder.addPropertyValue("locations", locations); } builder.addPropertyValue("ignoreResourceNotFound", Boolean.valueOf(element.getAttribute("ignore-resource-not-found"))); builder.addPropertyValue("localOverride", Boolean.valueOf(element.getAttribute("local-override"))); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } } }
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } } }
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { BeanDefinition bd = definition.getBeanDefinition(); Properties props = parserContext.getDelegate().parsePropsElement((Element) node); bd.getPropertyValues().addPropertyValue(propertyName, props); return definition; } }
@Override protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } final String encryptorBeanName = element.getAttribute(ENCRYPTOR_ATTRIBUTE); if (StringUtils.hasText(encryptorBeanName)) { builder.addPropertyReference("encryptor", encryptorBeanName); } }
protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.parseChild(element, parserContext, builder); Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); }
private Properties parseProperties(final Element element, final ParserContext parserContext) { Element propsElement = DomUtils.getChildElementByTagName(element, ShardingDataSourceBeanDefinitionParserTag.PROPS_TAG); return null == propsElement ? new Properties() : parserContext.getDelegate().parsePropsElement(propsElement); } }
private Properties parseProperties(final Element element, final ParserContext parserContext) { Element propsElement = DomUtils.getChildElementByTagName(element, ShardingDataSourceBeanDefinitionParserTag.PROPS_TAG); return null == propsElement ? new Properties() : parserContext.getDelegate().parsePropsElement(propsElement); } }
@Override protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } final String encryptorBeanName = element.getAttribute(ENCRYPTOR_ATTRIBUTE); if (StringUtils.hasText(encryptorBeanName)) { builder.addPropertyReference("encryptor", encryptorBeanName); } }
@Override protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } final String encryptorBeanName = element.getAttribute(ENCRYPTOR_ATTRIBUTE); if (StringUtils.hasText(encryptorBeanName)) { builder.addPropertyReference("encryptor", encryptorBeanName); } }
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); builder.addPropertyValue("properties", parsedProps); String location = element.getAttribute("location"); if (StringUtils.hasLength(location)) { location = parserContext.getReaderContext().getEnvironment().resolvePlaceholders(location); String[] locations = StringUtils.commaDelimitedListToStringArray(location); builder.addPropertyValue("locations", locations); } builder.addPropertyValue("ignoreResourceNotFound", Boolean.valueOf(element.getAttribute("ignore-resource-not-found"))); builder.addPropertyValue("localOverride", Boolean.valueOf(element.getAttribute("local-override"))); String scope = element.getAttribute(SCOPE_ATTRIBUTE); if (StringUtils.hasLength(scope)) { builder.setScope(scope); } } }
private Object getProperties(Element eProperties, ParserContext context, BeanDefinition definition) { Object value; List<Element> childElements = DOMUtils.getElements(eProperties); if (!childElements.isEmpty()) { Element eChild = childElements.get(0); String ns = eChild.getNamespaceURI(); String childName = eChild.getLocalName(); if ("http://www.springframework.org/schema/util".equals(ns) && "properties".equals(childName)) { value = context.getDelegate().parseCustomElement(eChild, definition); } else if ("http://www.springframework.org/schema/beans".equals(ns) && "props".equals(childName)) { value = context.getDelegate().parsePropsElement(eChild); } else { log.error(String.format("Cannot parse properties for %s#%s", ns, childName)); value = null; } } else { value = null; } return value; }
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { // parse attributes using conventions super.doParse(element, parserContext, builder); // parse nested element (if any) Properties parsedProps = parserContext.getDelegate().parsePropsElement(element); if (!parsedProps.isEmpty()) { if (builder.getRawBeanDefinition().getPropertyValues().contains(PROPERTIES_PROP)) { parserContext.getReaderContext().error( "Property '" + PROPERTIES_PROP + "' is defined more then once. Only one approach may be used per property.", element); } builder.addPropertyValue(PROPERTIES_PROP, parsedProps); } } }
Properties properties = parserContext.getDelegate().parsePropsElement(propertiesElement); if (properties != null && !properties.isEmpty()) { factoryPropertyValues.addPropertyValue("properties", properties);
return parsePropsElement(ele);