1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package net.sf.morph.transform;
17  
18  import net.sf.composite.Component;
19  
20  /**
21   * <p>Transforms information taken from a source and makes it available at a
22   * destination.  Each source class is implicitly considered transformable to each
23   * destination class, unless this is an {@link net.sf.morph.transform.ExplicitTransformer}.</p>
24   * 
25   * <p>For performance reasons, it is recommended that transformers be
26   * implemented in a threadsafe manner.  All transformers provided out-of-the-box
27   * by the Morph framework are threadsafe.</p>
28   * 
29   * @author Matt Sgarlata
30   * @since Nov 26, 2004
31   */
32  public interface Transformer extends Component {
33  	
34  	public static final Integer TRANSFORMATION_TYPE_CONVERT = new Integer(1);
35  	public static final Integer TRANSFORMATION_TYPE_COPY = new Integer(2);
36  	
37  	/**
38  	 * Defines the types of objects that can be used as information sources by
39  	 * this transformer. This can be thought of as the valid "output" types for
40  	 * the transformer.
41  	 * 
42  	 * @return the types of objects that can be used as information sources by
43  	 *         this transformer
44  	 */
45  	public Class[] getSourceClasses();
46  
47  	/**
48  	 * Defines the types of objects that can be used as information sources by
49  	 * this transformer. This method can be thought of as specifying the valid
50  	 * "output" types for this transformer.
51  	 * 
52  	 * @return the types of objects that can be used as information sources by
53  	 *         this transformer
54  	 */
55  	public Class[] getDestinationClasses();
56  	
57  }