1
2
3
4
5
6
7 package org.mule.config.spring.parsers.processors;
8
9 import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser;
10 import org.mule.config.spring.parsers.PreProcessor;
11 import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration;
12 import org.mule.config.spring.parsers.generic.AutoIdUtils;
13
14 import org.w3c.dom.Element;
15
16 public class ProvideDefaultNameFromElement implements PreProcessor
17 {
18
19 public void preProcess(PropertyConfiguration config, Element element)
20 {
21 if (AutoIdUtils.blankAttribute(element, AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME))
22 {
23 element.setAttribute(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME, element.getLocalName());
24 }
25 }
26
27 }