1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.morph.transform.copiers;
17
18 import java.util.Locale;
19
20 import net.sf.morph.transform.DecoratedConverter;
21 import net.sf.morph.transform.DecoratedCopier;
22 import net.sf.morph.transform.TransformationException;
23 import net.sf.morph.transform.transformers.BaseReflectorTransformer;
24
25 /**
26 * Combines all of the contents of a container into a single container. If any
27 * of the contents of the source container are containers themselves, the
28 * elements are extracted and put into the destination container. Examples:
29 * <ul>
30 * <li>combines an array of Lists into just a single array, with all the
31 * elements from each List copied into the destination array</li>
32 * <li>combines [14, "hello", ["this", "is", "another", "array"], "the", "end"]
33 * (this is a list with 5 elements, a number, a string, an array, and two more
34 * strings) into [14, "hello", "this", "is", "another", "array", "the", "end]
35 * (this list has 8 elements, a number and 7 strings)</li>
36 * </ul>
37 * UNFINISHED
38 * @author Matt Sgarlata
39 * @since Dec 5, 2004
40 */
41 public class CombiningCopier extends BaseReflectorTransformer implements DecoratedCopier,
42 DecoratedConverter {
43
44 /**
45 * Create a new CombiningCopier.
46 */
47 public CombiningCopier() {
48 super();
49 }
50
51 /**
52 * {@inheritDoc}
53 */
54 protected void copyImpl(Object destination, Object source, Locale locale, Integer preferredTransformationType) throws TransformationException {
55
56 throw new UnsupportedOperationException("not implemented");
57 }
58
59 /**
60 * {@inheritDoc}
61 */
62 protected Class[] getSourceClassesImpl() throws Exception {
63 return getContainerReflector().getReflectableClasses();
64 }
65
66 /**
67 * {@inheritDoc}
68 */
69 protected Class[] getDestinationClassesImpl() throws Exception {
70
71 return null;
72 }
73
74 }