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