1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.config.spring.parsers.processors; |
12 | |
|
13 | |
import org.mule.config.spring.parsers.PostProcessor; |
14 | |
import org.mule.config.spring.parsers.PreProcessor; |
15 | |
import org.mule.config.spring.parsers.assembly.BeanAssembler; |
16 | |
import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration; |
17 | |
|
18 | |
import org.w3c.dom.Element; |
19 | |
import org.springframework.beans.factory.xml.ParserContext; |
20 | |
|
21 | |
public class AddAttribute implements PreProcessor, PostProcessor |
22 | |
{ |
23 | |
|
24 | |
private String name; |
25 | |
private String value; |
26 | |
|
27 | |
public AddAttribute(String name, String value) |
28 | 0 | { |
29 | 0 | this.name = name; |
30 | 0 | this.value = value; |
31 | 0 | } |
32 | |
|
33 | |
public void postProcess(ParserContext unused, BeanAssembler assembler, Element element) |
34 | |
{ |
35 | 0 | element.setAttribute(name, value); |
36 | 0 | } |
37 | |
|
38 | |
public void preProcess(PropertyConfiguration config, Element element) |
39 | |
{ |
40 | 0 | element.setAttribute(name, value); |
41 | 0 | } |
42 | |
|
43 | |
} |