Coverage Report - org.mule.extras.spring.config.TransformerEditor
 
Classes in this File Line Coverage Branch Coverage Complexity
TransformerEditor
71%
5/7
50%
1/2
2
 
 1  
 /*
 2  
  * $Id: TransformerEditor.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 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.extras.spring.config;
 12  
 
 13  
 import org.mule.MuleException;
 14  
 import org.mule.util.MuleObjectHelper;
 15  
 
 16  
 import java.beans.PropertyEditorSupport;
 17  
 
 18  
 import org.apache.commons.logging.Log;
 19  
 import org.apache.commons.logging.LogFactory;
 20  
 
 21  
 /**
 22  
  * <code>TransformerEditor</code> is used to convert Transformer names into
 23  
  * transformer Objects
 24  
  */
 25  60
 public class TransformerEditor extends PropertyEditorSupport
 26  
 {
 27  
     /**
 28  
      * logger used by this class
 29  
      */
 30  4
     protected static final Log logger = LogFactory.getLog(TransformerEditor.class);
 31  
 
 32  
     public void setAsText(String text)
 33  
     {
 34  
         try
 35  
         {
 36  18
             setValue(MuleObjectHelper.getTransformer(text, (text.indexOf(",") > -1 ? "," : " ")));
 37  
         }
 38  0
         catch (MuleException e)
 39  
         {
 40  0
             logger.error(e.getMessage(), e);
 41  18
         }
 42  18
     }
 43  
 }