Java Code Examples for org.springframework.beans.factory.support.ManagedSet#setMergeEnabled()
The following examples show how to use
org.springframework.beans.factory.support.ManagedSet#setMergeEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomSchemaParser.java From rice with Educational Community License v2.0 | 6 votes |
/** * Parses a list of elements into a set of beans/standard content. * * @param grandChildren - The set of beans/content in a bean property * @param child - The property tag for the parent. * @param parent - The parent bean that the tag is nested in. * @param parserContext - Provided information and functionality regarding current bean set. * @return A managedSet of the nested content. */ protected ManagedSet parseSet(ArrayList<Element> grandChildren, Element child, BeanDefinitionBuilder parent, ParserContext parserContext) { ManagedSet setItems = new ManagedSet(); for (int i = 0; i < grandChildren.size(); i++) { Element grandChild = grandChildren.get(i); if (child.getTagName().compareTo("value") == 0) { setItems.add(grandChild.getTextContent()); } else { setItems.add(parseBean(grandChild, parent, parserContext)); } } String merge = child.getAttribute("merge"); if (merge != null) { setItems.setMergeEnabled(Boolean.valueOf(merge)); } return setItems; }
Example 2
Source File: DictionaryBeanFactoryPostProcessor.java From rice with Educational Community License v2.0 | 6 votes |
/** * Iterates through the set values and calls helpers to process the value * * @param setVal the set to process * @param propertyName name of the property which has the set value * @param nestedBeanStack stack of bean containers which contains the set property */ protected void visitSet(Set setVal, String propertyName, Stack<BeanDefinitionHolder> nestedBeanStack) { boolean isMergeEnabled = false; if (setVal instanceof ManagedSet) { isMergeEnabled = ((ManagedSet) setVal).isMergeEnabled(); } ManagedSet newSet = new ManagedSet(); newSet.setMergeEnabled(isMergeEnabled); for (Object elem : setVal) { if (isStringValue(elem)) { elem = processSetStringPropertyValue(propertyName, setVal, getString(elem), nestedBeanStack, beanProcessors); } else { elem = visitPropertyValue(propertyName, elem, nestedBeanStack); } newSet.add(elem); } setVal.clear(); setVal.addAll(newSet); }
Example 3
Source File: BeanDefinitionParserDelegate.java From spring-analysis-note with MIT License | 5 votes |
/** * Parse a set element. */ public Set<Object> parseSetElement(Element collectionEle, @Nullable BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<>(nl.getLength()); target.setSource(extractSource(collectionEle)); target.setElementTypeName(defaultElementType); target.setMergeEnabled(parseMergeAttribute(collectionEle)); parseCollectionElements(nl, target, bd, defaultElementType); return target; }
Example 4
Source File: BeanDefinitionParserDelegate.java From java-technology-stack with MIT License | 5 votes |
/** * Parse a set element. */ public Set<Object> parseSetElement(Element collectionEle, @Nullable BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<>(nl.getLength()); target.setSource(extractSource(collectionEle)); target.setElementTypeName(defaultElementType); target.setMergeEnabled(parseMergeAttribute(collectionEle)); parseCollectionElements(nl, target, bd, defaultElementType); return target; }
Example 5
Source File: BeanDefinitionParserDelegate.java From lams with GNU General Public License v2.0 | 5 votes |
/** * Parse a set element. */ public Set<Object> parseSetElement(Element collectionEle, BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<Object>(nl.getLength()); target.setSource(extractSource(collectionEle)); target.setElementTypeName(defaultElementType); target.setMergeEnabled(parseMergeAttribute(collectionEle)); parseCollectionElements(nl, target, bd, defaultElementType); return target; }
Example 6
Source File: BeanDefinitionParserDelegate.java From blog_demos with Apache License 2.0 | 5 votes |
/** * Parse a set element. */ public Set<Object> parseSetElement(Element collectionEle, BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<Object>(nl.getLength()); target.setSource(extractSource(collectionEle)); target.setElementTypeName(defaultElementType); target.setMergeEnabled(parseMergeAttribute(collectionEle)); parseCollectionElements(nl, target, bd, defaultElementType); return target; }
Example 7
Source File: BeanDefinitionParserDelegate.java From spring4-understanding with Apache License 2.0 | 5 votes |
/** * Parse a set element. */ public Set<Object> parseSetElement(Element collectionEle, BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<Object>(nl.getLength()); target.setSource(extractSource(collectionEle)); target.setElementTypeName(defaultElementType); target.setMergeEnabled(parseMergeAttribute(collectionEle)); parseCollectionElements(nl, target, bd, defaultElementType); return target; }