View Javadoc
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.tck.testmodels.mule;
8   
9   import org.mule.api.transformer.TransformerException;
10  import org.mule.transformer.compression.AbstractCompressionTransformer;
11  import org.mule.util.compression.GZipCompression;
12  
13  public class TestCompressionTransformer extends AbstractCompressionTransformer
14  {
15  
16      private String beanProperty1;
17      private String containerProperty;
18  
19      private int beanProperty2;
20  
21      public TestCompressionTransformer()
22      {
23          super();
24          this.setStrategy(new GZipCompression());
25      }
26  
27      @Override
28      public Object doTransform(Object src, String encoding) throws TransformerException
29      {
30          return null;
31      }
32  
33      public String getBeanProperty1()
34      {
35          return beanProperty1;
36      }
37  
38      public void setBeanProperty1(String beanProperty1)
39      {
40          this.beanProperty1 = beanProperty1;
41      }
42  
43      public int getBeanProperty2()
44      {
45          return beanProperty2;
46      }
47  
48      public void setBeanProperty2(int beanProperty2)
49      {
50          this.beanProperty2 = beanProperty2;
51      }
52  
53      public String getContainerProperty()
54      {
55          return containerProperty;
56      }
57  
58      public void setContainerProperty(String containerProperty)
59      {
60          this.containerProperty = containerProperty;
61      }
62  
63      @Override
64      public Object clone() throws CloneNotSupportedException
65      {
66          if (containerProperty == null)
67          {
68              throw new IllegalStateException(
69                  "Transformer cannot be cloned until all properties have been set on it");
70          }
71  
72          return super.clone();
73      }
74  
75  }