@Nullable public BeanDefinition parseCustomElement(Element ele) { return parseCustomElement(ele, null); }
@Nullable public BeanDefinition parseCustomElement(Element ele) { return parseCustomElement(ele, null); }
@Nullable private BeanDefinitionHolder parseNestedCustomElement(Element ele, @Nullable BeanDefinition containingBd) { BeanDefinition innerDefinition = parseCustomElement(ele, containingBd); if (innerDefinition == null) { error("Incorrect usage of element '" + ele.getNodeName() + "' in a nested manner. " + "This tag cannot be used nested inside <property>.", ele); return null; } String id = ele.getNodeName() + BeanDefinitionReaderUtils.GENERATED_BEAN_NAME_SEPARATOR + ObjectUtils.getIdentityHexString(innerDefinition); if (logger.isTraceEnabled()) { logger.trace("Using generated bean name [" + id + "] for nested custom element '" + ele.getNodeName() + "'"); } return new BeanDefinitionHolder(innerDefinition, id); }
/** * Parse the elements at the root level in the document: * "import", "alias", "bean". * @param root the DOM root element of the document */ protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) { if (delegate.isDefaultNamespace(root)) { NodeList nl = root.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (delegate.isDefaultNamespace(ele)) { parseDefaultElement(ele, delegate); } else { delegate.parseCustomElement(ele); } } } } else { delegate.parseCustomElement(root); } }
@Nullable private BeanDefinitionHolder parseNestedCustomElement(Element ele, @Nullable BeanDefinition containingBd) { BeanDefinition innerDefinition = parseCustomElement(ele, containingBd); if (innerDefinition == null) { error("Incorrect usage of element '" + ele.getNodeName() + "' in a nested manner. " + "This tag cannot be used nested inside <property>.", ele); return null; } String id = ele.getNodeName() + BeanDefinitionReaderUtils.GENERATED_BEAN_NAME_SEPARATOR + ObjectUtils.getIdentityHexString(innerDefinition); if (logger.isTraceEnabled()) { logger.trace("Using generated bean name [" + id + "] for nested custom element '" + ele.getNodeName() + "'"); } return new BeanDefinitionHolder(innerDefinition, id); }
private void parseNested(Element element, String eltType, ParserContext parserContext, BeanDefinitionBuilder builder, RedissonNamespaceParserSupport helper) { NodeList list = element.getElementsByTagNameNS( RedissonNamespaceParserSupport.REDISSON_NAMESPACE, eltType); if (list.getLength() == 1) { Element elt = (Element) list.item(0); helper.setAttribute(elt, RedissonNamespaceParserSupport.READ_WRITE_LOCK_REF_ATTRIBUTE, helper.getAttribute(element, RedissonNamespaceParserSupport.ID_ATTRIBUTE)); parserContext.getDelegate() .parseCustomElement(elt, builder.getRawBeanDefinition()); } } }
private void parseNested(Element element, String eltType, ParserContext parserContext, BeanDefinitionBuilder builder, RedissonNamespaceParserSupport helper) { NodeList list = element.getElementsByTagNameNS( RedissonNamespaceParserSupport.REDISSON_NAMESPACE, eltType); if (list.getLength() == 1) { Element elt = (Element) list.item(0); helper.setAttribute(elt, RedissonNamespaceParserSupport.READ_WRITE_LOCK_REF_ATTRIBUTE, helper.getAttribute(element, RedissonNamespaceParserSupport.ID_ATTRIBUTE)); parserContext.getDelegate() .parseCustomElement(elt, builder.getRawBeanDefinition()); } } }
/** * Parse the elements at the root level in the document: * "import", "alias", "bean". * @param root the DOM root element of the document */ protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) { if (delegate.isDefaultNamespace(root)) { NodeList nl = root.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (delegate.isDefaultNamespace(ele)) { parseDefaultElement(ele, delegate); } else { delegate.parseCustomElement(ele); } } } } else { delegate.parseCustomElement(root); } }
private void parseNested(Element element, String eltType, ParserContext parserContext, BeanDefinitionBuilder builder, RedissonNamespaceParserSupport helper) { NodeList list = element.getElementsByTagNameNS( RedissonNamespaceParserSupport.REDISSON_NAMESPACE, eltType); if (list.getLength() == 1) { Element elt = (Element) list.item(0); if (StringUtils.hasText(referenceAttribute)) { helper.setAttribute(elt, referenceAttribute, helper.getAttribute(element, RedissonNamespaceParserSupport.ID_ATTRIBUTE)); helper.setAttribute(elt, RedissonNamespaceParserSupport.REDISSON_REF_ATTRIBUTE, helper.getAttribute(element, RedissonNamespaceParserSupport.REDISSON_REF_ATTRIBUTE)); } parserContext.getDelegate() .parseCustomElement(elt, builder.getRawBeanDefinition()); } } }
private void parseNested(Element element, String eltType, ParserContext parserContext, BeanDefinitionBuilder builder, RedissonNamespaceParserSupport helper) { NodeList list = element.getElementsByTagNameNS( RedissonNamespaceParserSupport.REDISSON_NAMESPACE, eltType); if (list.getLength() == 1) { Element elt = (Element) list.item(0); if (StringUtils.hasText(referenceAttribute)) { helper.setAttribute(elt, referenceAttribute, helper.getAttribute(element, RedissonNamespaceParserSupport.ID_ATTRIBUTE)); helper.setAttribute(elt, RedissonNamespaceParserSupport.REDISSON_REF_ATTRIBUTE, helper.getAttribute(element, RedissonNamespaceParserSupport.REDISSON_REF_ATTRIBUTE)); } parserContext.getDelegate() .parseCustomElement(elt, builder.getRawBeanDefinition()); } } }
parserContext.getDelegate().parseCustomElement(elt, bd); id = elt.getAttribute( RedissonNamespaceParserSupport.ID_ATTRIBUTE);
parserContext.getDelegate().parseCustomElement(elt, bd); id = elt.getAttribute( RedissonNamespaceParserSupport.ID_ATTRIBUTE);
pc.getDelegate().parseCustomElement(userServiceElt, authProvider);
private void parseChildElements(Element element, String parentId, String redissonRef, BeanDefinitionBuilder redissonDef, ParserContext parserContext) { if (element.hasChildNodes()) { CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(parentId, parserContext.extractSource(element)); parserContext.pushContainingComponent(compositeDef); List<Element> childElts = DomUtils.getChildElements(element); for (Element elt : childElts) { if(BeanDefinitionParserDelegate .QUALIFIER_ELEMENT.equals(elt.getLocalName())) { continue;//parsed elsewhere } String localName = parserContext.getDelegate().getLocalName(elt); localName = Conventions.attributeNameToPropertyName(localName); if (ConfigType.contains(localName)) { parseConfigTypes(elt, localName, redissonDef, parserContext); } else if (AddressType.contains(localName)) { parseAddressTypes(elt, localName, redissonDef, parserContext); } else if (helper.isRedissonNS(elt)) { elt.setAttribute(REDISSON_REF, redissonRef); parserContext.getDelegate().parseCustomElement(elt); } } parserContext.popContainingComponent(); } }
private void parseChildElements(Element element, String parentId, String redissonRef, BeanDefinitionBuilder redissonDef, ParserContext parserContext) { if (element.hasChildNodes()) { CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(parentId, parserContext.extractSource(element)); parserContext.pushContainingComponent(compositeDef); List<Element> childElts = DomUtils.getChildElements(element); for (Element elt : childElts) { if(BeanDefinitionParserDelegate .QUALIFIER_ELEMENT.equals(elt.getLocalName())) { continue;//parsed elsewhere } String localName = parserContext.getDelegate().getLocalName(elt); localName = Conventions.attributeNameToPropertyName(localName); if (ConfigType.contains(localName)) { parseConfigTypes(elt, localName, redissonDef, parserContext); } else if (AddressType.contains(localName)) { parseAddressTypes(elt, localName, redissonDef, parserContext); } else if (helper.isRedissonNS(elt)) { elt.setAttribute(REDISSON_REF, redissonRef); parserContext.getDelegate().parseCustomElement(elt); } } parserContext.popContainingComponent(); } }
value = parserContext.getDelegate().parseCustomElement(nestedElement);
public BeanDefinition parseCustomElement(Element ele) { return parseCustomElement(ele, null); }
private void addFlowExecutionListenerLoader(Element element, ParserContext parserContext, BeanDefinitionBuilder definitionBuilder) { Element listenersElement = DomUtils.getChildElementByTagName(element, "flow-execution-listeners"); if (listenersElement != null) { definitionBuilder.addPropertyValue("flowExecutionListenerLoader", parserContext.getDelegate() .parseCustomElement(listenersElement, definitionBuilder.getBeanDefinition())); } } }
private BeanDefinitionHolder parseNestedCustomElement(Element ele, BeanDefinition containingBd) { BeanDefinition innerDefinition = parseCustomElement(ele, containingBd); if (innerDefinition == null) { error("Incorrect usage of element '" + ele.getNodeName() + "' in a nested manner. " + "This tag cannot be used nested inside <property>.", ele); return null; } String id = ele.getNodeName() + BeanDefinitionReaderUtils.GENERATED_BEAN_NAME_SEPARATOR + ObjectUtils.getIdentityHexString(innerDefinition); if (logger.isDebugEnabled()) { logger.debug("Using generated bean name [" + id + "] for nested custom element '" + ele.getNodeName() + "'"); } return new BeanDefinitionHolder(innerDefinition, id); }
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { Element config = DomUtils.getChildElementByTagName(element,"config"); if (config != null) { builder.addPropertyValue("config", parserContext.getDelegate().parseCustomElement(config,builder.getRawBeanDefinition())); } String lookupConfig = element.getAttribute("lookupConfig"); if (StringUtils.hasLength(lookupConfig)) { builder.addPropertyValue("lookupConfig", Boolean.parseBoolean(lookupConfig)); } else { builder.addPropertyValue("lookupConfig",false); } String systemPropertiesMode = element.getAttribute("systemPropertiesMode"); if (StringUtils.hasLength(systemPropertiesMode)) { builder.addPropertyValue("systemPropertiesMode",systemPropertiesMode); } }