KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > transformer > UMOSimpleTransformer


1 /*
2  * $Id: UMOSimpleTransformer.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.umo.transformer;
12
13 import org.mule.umo.lifecycle.Initialisable;
14
15 import java.io.Serializable JavaDoc;
16
17 /**
18  * <code>UMOSimpleTransformer</code> manages the transformation and or translation
19  * of one type of data to the other. Source data is received, then processed and
20  * returned via the <code>transform()</code> method. <p/> The return Class is
21  * specifed so that the return message is validated defore it is returned.
22  *
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26
27 public interface UMOSimpleTransformer extends Initialisable, Serializable JavaDoc, Cloneable JavaDoc
28 {
29     /**
30      * JDK1.3+ 'Service Provider' specification (
31      * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
32      */

33     String JavaDoc SERVICE_ID = "META-INF/services/org.mule.umo.transformer.UMOTransformer";
34
35     /**
36      * Thransforms the supllied data and returns the result
37      *
38      * @param src the data to transform
39      * @return the transformed data
40      * @throws TransformerException if a error occurs transforming the data or if the
41      * expected returnClass isn't the same as the transformed data
42      */

43     Object JavaDoc transform(Object JavaDoc src) throws TransformerException;
44
45     /**
46      * @param newName the logical name for the transformer
47      */

48     void setName(String JavaDoc newName);
49
50     /**
51      * @return the logical name of the transformer
52      */

53     String JavaDoc getName();
54
55     /**
56      * Sets the expected return type for the transformed data. If the transformed
57      * data is not of this class type a <code>TransformerException</code> will be
58      * thrown.
59      *
60      * @param theClass the expected return type class
61      */

62     void setReturnClass(Class JavaDoc theClass);
63
64     /**
65      * @return the exceptedreturn type
66      */

67     Class JavaDoc getReturnClass();
68
69     // TODO shouldn't have to declare this but eclipse?? throws an error
70
Object JavaDoc clone() throws CloneNotSupportedException JavaDoc;
71
72     UMOTransformer getNextTransformer();
73
74     void setNextTransformer(UMOTransformer nextTransformer);
75 }
76
Popular Tags