1
2
3
4
5
6
7 package org.mule.config.spring.parsers.specific;
8
9 import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser;
10 import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
11
12 import org.w3c.dom.Element;
13
14 public class ComponentDefinitionParser extends ChildDefinitionParser
15 {
16
17 public ComponentDefinitionParser(Class clazz)
18 {
19 super("messageProcessor", clazz);
20 this.singleton = false;
21 addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_CLASS);
22 }
23
24 @Override
25 public String getPropertyName(Element e)
26 {
27 String parent = e.getParentNode().getLocalName().toLowerCase();
28 if ("service".equals(parent) || "custom-service".equals(parent))
29 {
30 return "component";
31 }
32 else
33 {
34 return super.getPropertyName(e);
35 }
36 }
37 }