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