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