Coverage Report - org.mule.module.xml.transformer.wire.XStreamWireFormat
 
Classes in this File Line Coverage Branch Coverage Complexity
XStreamWireFormat
100%
15/15
N/A
1
 
 1  
 /*
 2  
  * $Id: XStreamWireFormat.java 11377 2008-03-16 18:18:33Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 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  
  * Serializes objects using XStream. This is equivelent of using the ObjectToXml and
 23  
  * XmlToObject except that there is no source or return type checking.
 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  
         // TODO This is currently needed as a workaround for MULE-2881, this needs to
 46  
         // be removed is this is not the solution to MULE-2881
 47  12
         out.setAcceptUMOMessage(true);
 48  12
         setOutboundTransformer(out);
 49  12
     }
 50  
 
 51  
 }