1   /*
2    * $Id: StringAppendTransformer.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.providers.vm.issues;
12  
13  import org.mule.transformers.AbstractTransformer;
14  import org.mule.umo.transformer.TransformerException;
15  
16  public class StringAppendTransformer extends AbstractTransformer
17  {
18  
19      public static final String DEFAULT_TEXT = " transformed";
20      private String text;
21  
22      public StringAppendTransformer()
23      {
24          this(DEFAULT_TEXT);
25      }
26  
27      public StringAppendTransformer(String text)
28      {
29          setText(text);
30      }
31  
32      protected Object doTransform(Object src, String encoding) throws TransformerException
33      {
34          return ((String) src) + getText();
35      }
36  
37      public String getText()
38      {
39          return text;
40      }
41  
42      public void setText(String text)
43      {
44          this.text = text;
45      }
46      
47  }