1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.parsers.processors; |
8 | |
|
9 | |
import org.mule.config.spring.parsers.PreProcessor; |
10 | |
import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser; |
11 | |
import org.mule.config.spring.parsers.generic.AutoIdUtils; |
12 | |
import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration; |
13 | |
|
14 | |
import org.w3c.dom.Element; |
15 | |
|
16 | |
public class ProvideDefaultName implements PreProcessor |
17 | |
{ |
18 | |
|
19 | |
private String prefix; |
20 | |
|
21 | |
public ProvideDefaultName(String prefix) |
22 | 0 | { |
23 | 0 | this.prefix = prefix; |
24 | 0 | } |
25 | |
|
26 | |
public void preProcess(PropertyConfiguration config, Element element) |
27 | |
{ |
28 | 0 | element.setAttribute(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME, |
29 | |
AutoIdUtils.getUniqueName(element, prefix)); |
30 | 0 | } |
31 | |
|
32 | |
} |