KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > extras > spring > config > TransformerEditor


1 /*
2  * $Id: TransformerEditor.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
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 java.beans.PropertyEditorSupport JavaDoc;
14
15 import org.apache.commons.logging.Log;
16 import org.apache.commons.logging.LogFactory;
17 import org.mule.MuleException;
18 import org.mule.util.MuleObjectHelper;
19
20 /**
21  * <code>TransformerEditor</code> is used to convert Transformer names into
22  * transformer Objects
23  */

24 public class TransformerEditor extends PropertyEditorSupport JavaDoc
25 {
26     /**
27      * logger used by this class
28      */

29     protected static Log logger = LogFactory.getLog(TransformerEditor.class);
30
31     public void setAsText(String JavaDoc text)
32     {
33         try
34         {
35             setValue(MuleObjectHelper.getTransformer(text, (text.indexOf(",") > -1 ? "," : " ")));
36         }
37         catch (MuleException e)
38         {
39             logger.error(e.getMessage(), e);
40         }
41     }
42 }
43
Popular Tags