1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.module.xml.transformer.wire; |
12 | |
|
13 | |
import org.mule.module.xml.transformer.ObjectToXml; |
14 | |
import org.mule.module.xml.transformer.XStreamFactory; |
15 | |
import org.mule.module.xml.transformer.XmlToObject; |
16 | |
import org.mule.transformer.wire.TransformerPairWireFormat; |
17 | |
|
18 | |
import java.util.List; |
19 | |
import java.util.Map; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
public class XStreamWireFormat extends TransformerPairWireFormat |
26 | |
{ |
27 | |
public XStreamWireFormat() throws IllegalAccessException, InstantiationException, ClassNotFoundException |
28 | |
{ |
29 | 12 | this(XStreamFactory.XSTREAM_XPP_DRIVER, null, null); |
30 | 12 | } |
31 | |
|
32 | |
public XStreamWireFormat(String driverClassName, Map aliases, List converters) |
33 | |
throws IllegalAccessException, InstantiationException, ClassNotFoundException |
34 | 12 | { |
35 | 12 | XmlToObject in = new XmlToObject(); |
36 | 12 | in.setDriverClassName(driverClassName); |
37 | 12 | in.setAliases(aliases); |
38 | 12 | in.setConverters(converters); |
39 | 12 | setInboundTransformer(in); |
40 | |
|
41 | 12 | ObjectToXml out = new ObjectToXml(); |
42 | 12 | out.setDriverClassName(driverClassName); |
43 | 12 | out.setAliases(aliases); |
44 | 12 | out.setConverters(converters); |
45 | |
|
46 | |
|
47 | 12 | out.setAcceptUMOMessage(true); |
48 | 12 | setOutboundTransformer(out); |
49 | 12 | } |
50 | |
|
51 | |
} |