View Javadoc

1   /*
2    * Copyright 2004-2005 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.morph.transform;
17  
18  /**
19   * <p>
20   * An extension of the Copier interface that defines a few more convenient
21   * methods. All methods specified in this interface can be easily implemented
22   * using just the methods in the Copier interface. Thus, if you are defining
23   * your own copier you should implement the only Copier interface. If you extend
24   * from {@link net.sf.morph.transform.converters.BaseCopier}, your copier will
25   * implement this inteface automatically. If you don't want to extend from
26   * <code>BaseCopier</code>, you can easily expose this interface by using the
27   * {@link net.sf.morph.transform.copiers.CopierDecorator}.
28   * </p>
29   * 
30   * <p>
31   * <em>You should not directly implement this interface, because additional
32   * methods may be introduced in later versions of Morph.  Instead, implement the
33   * Copier interface and use the CopierDecorator to expose this interface.</em>
34   * </p>
35   * 
36   * @author Matt Sgarlata
37   * @since Dec 5, 2004
38   */
39  public interface DecoratedCopier extends Copier, DecoratedTransformer {
40  
41  	/**
42  	 * <p>
43  	 * Copies information from the given source to the given destination.
44  	 * </p>
45  	 * 
46  	 * @param destination
47  	 *            the object to which information is written
48  	 * @param source
49  	 *            the object from which information is read
50  	 * @throws TransformationException
51  	 *             if <code>source</code> or <code>destination</code> are
52  	 *             null
53  	 */
54  	public void copy(Object destination, Object source)
55  		throws TransformationException;	
56  	
57  }