1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.parsers.specific.properties; |
8 | |
|
9 | |
import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser; |
10 | |
import org.mule.config.spring.parsers.assembly.MapEntryCombiner; |
11 | |
import org.mule.config.spring.parsers.collection.ChildSingletonMapDefinitionParser; |
12 | |
import org.mule.config.spring.parsers.delegate.AbstractSingleParentFamilyDefinitionParser; |
13 | |
import org.mule.config.spring.parsers.processors.AddAttribute; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
public class ElementInNestedMapDefinitionParser extends AbstractSingleParentFamilyDefinitionParser |
21 | |
{ |
22 | |
|
23 | |
public ElementInNestedMapDefinitionParser(String mapSetter, String mapKey, String keyAttribute) |
24 | 0 | { |
25 | |
|
26 | 0 | setReturnFirstResult(false); |
27 | 0 | addDelegate(new ChildSingletonMapDefinitionParser(mapSetter)) |
28 | |
.registerPreProcessor(new AddAttribute(MapEntryCombiner.KEY, mapKey)) |
29 | |
.addCollection(mapSetter) |
30 | |
.setIgnoredDefault(true) |
31 | |
.removeIgnored(MapEntryCombiner.KEY) |
32 | |
.addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME); |
33 | 0 | addChildDelegate(new ChildSingletonMapDefinitionParser(MapEntryCombiner.VALUE)) |
34 | |
.addAlias(keyAttribute, MapEntryCombiner.KEY) |
35 | |
.addCollection(MapEntryCombiner.VALUE) |
36 | |
.addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME); |
37 | 0 | } |
38 | |
|
39 | |
} |