KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > tck > testmodels > mule > TestCompressionTransformer


1 /*
2  * $Id: TestCompressionTransformer.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.tck.testmodels.mule;
12
13 import org.mule.transformers.compression.AbstractCompressionTransformer;
14 import org.mule.umo.transformer.TransformerException;
15 import org.mule.util.compression.GZipCompression;
16
17 /**
18  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
19  * @version $Revision: 3798 $
20  */

21
22 public class TestCompressionTransformer extends AbstractCompressionTransformer
23 {
24     /**
25      * Serial version
26      */

27     private static final long serialVersionUID = -1742674557192926869L;
28
29     private String JavaDoc beanProperty1;
30     private String JavaDoc containerProperty;
31
32     private int beanProperty2;
33
34     public TestCompressionTransformer()
35     {
36         super();
37         this.setStrategy(new GZipCompression());
38     }
39
40     public Object JavaDoc doTransform(Object JavaDoc src, String JavaDoc encoding) throws TransformerException
41     {
42         return null;
43     }
44
45     public String JavaDoc getBeanProperty1()
46     {
47         return beanProperty1;
48     }
49
50     public void setBeanProperty1(String JavaDoc beanProperty1)
51     {
52         this.beanProperty1 = beanProperty1;
53     }
54
55     public int getBeanProperty2()
56     {
57         return beanProperty2;
58     }
59
60     public void setBeanProperty2(int beanProperty2)
61     {
62         this.beanProperty2 = beanProperty2;
63     }
64
65     public String JavaDoc getContainerProperty()
66     {
67         return containerProperty;
68     }
69
70     public void setContainerProperty(String JavaDoc containerProperty)
71     {
72         this.containerProperty = containerProperty;
73     }
74
75     /*
76      * (non-Javadoc)
77      *
78      * @see java.lang.Object#clone() ensures that isn't not cloned before all
79      * properties have been set on it
80      */

81     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc
82     {
83         if (containerProperty == null)
84         {
85             throw new IllegalStateException JavaDoc(
86                 "Transformer cannot be cloned until all properties have been set on it");
87         }
88         return super.clone();
89     }
90
91 }
92
Popular Tags