Coverage Report - org.mule.module.xml.transformer.wire.XStreamWireFormat
 
Classes in this File Line Coverage Branch Coverage Complexity
XStreamWireFormat
0%
0/15
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.xml.transformer.wire;
 8  
 
 9  
 import org.mule.module.xml.transformer.ObjectToXml;
 10  
 import org.mule.module.xml.transformer.XStreamFactory;
 11  
 import org.mule.module.xml.transformer.XmlToObject;
 12  
 import org.mule.transformer.wire.TransformerPairWireFormat;
 13  
 
 14  
 import java.util.Map;
 15  
 import java.util.Set;
 16  
 
 17  
 /**
 18  
  * Serializes objects using XStream. This is equivelent of using the ObjectToXml and
 19  
  * XmlToObject except that there is no source or return type checking.
 20  
  */
 21  
 public class XStreamWireFormat extends TransformerPairWireFormat
 22  
 {
 23  
     
 24  
     public XStreamWireFormat() throws IllegalAccessException, InstantiationException, ClassNotFoundException
 25  
     {
 26  0
         this(XStreamFactory.XSTREAM_XPP_DRIVER, null, null);
 27  0
     }
 28  
 
 29  
     public XStreamWireFormat(String driverClassName, Map aliases, Set converters)
 30  
         throws IllegalAccessException, InstantiationException, ClassNotFoundException
 31  0
     {
 32  0
         XmlToObject in = new XmlToObject();
 33  0
         in.setDriverClass(driverClassName);
 34  0
         in.setAliases(aliases);
 35  0
         in.setConverters(converters);
 36  0
         setInboundTransformer(in);
 37  
 
 38  0
         ObjectToXml out = new ObjectToXml();
 39  0
         out.setDriverClass(driverClassName);
 40  0
         out.setAliases(aliases);
 41  0
         out.setConverters(converters);
 42  
         // TODO This is currently needed as a workaround for MULE-2881, this needs to
 43  
         // be removed is this is not the solution to MULE-2881
 44  0
         out.setAcceptMuleMessage(true);
 45  0
         setOutboundTransformer(out);
 46  0
     }
 47  
 
 48  
 }