1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.config.spring.parsers.specific.endpoint; |
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.AbstractSingleParentFamilyChildDefinitionParser; |
17 | |
import org.mule.config.spring.parsers.generic.ChildDefinitionParser; |
18 | |
import org.mule.config.spring.parsers.processors.AddAttribute; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
public class EndpointPropertyElementDefinitionParser extends AbstractSingleParentFamilyChildDefinitionParser |
26 | |
{ |
27 | |
public static final String ENDPOINT_PROPERTIES_ATTRIBUTE = "properties"; |
28 | |
|
29 | |
public EndpointPropertyElementDefinitionParser(String propertyKey, Class beanClass) |
30 | 0 | { |
31 | 0 | setReturnFirstResult(false); |
32 | 0 | addDelegate(new ChildSingletonMapDefinitionParser(ENDPOINT_PROPERTIES_ATTRIBUTE)).registerPreProcessor( |
33 | |
new AddAttribute(MapEntryCombiner.KEY, propertyKey)) |
34 | |
.addCollection(ENDPOINT_PROPERTIES_ATTRIBUTE) |
35 | |
.setIgnoredDefault(true) |
36 | |
.removeIgnored(MapEntryCombiner.KEY) |
37 | |
.addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME); |
38 | 0 | addChildDelegate(new ChildDefinitionParser(MapEntryCombiner.VALUE, beanClass)).addIgnored( |
39 | |
AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME).addIgnored(MapEntryCombiner.KEY); |
40 | 0 | } |
41 | |
} |