1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.morph.reflect;
17
18 import net.sf.composite.Component;
19 import net.sf.morph.wrap.Wrapper;
20
21 /**
22 * A reflector exposes the information contained within another object. There
23 * are two main types of reflectors: {@link net.sf.morph.reflect.BeanReflector}s
24 * and {@link net.sf.morph.reflect.ContainerReflector}s.
25 *
26 * @author Matt Sgarlata
27 * @since Nov 14, 2004
28 */
29 public interface Reflector extends Component {
30
31 /**
32 * Defines which classes are reflectable by this reflector. Each returned
33 * class and all its subclasses are reflectable by this reflector.
34 *
35 * @return the classes that are reflectable by this reflector.
36 */
37 public Class[] getReflectableClasses();
38
39 /**
40 * Optional operation: returns a wrapper for the given object.
41 *
42 * @param object
43 * the object for which a wrapper is desired
44 * @return the wrapper
45 * @throws UnsupportedOperationException
46 * if the reflector does not support retrieving wrappers
47 */
48 public Wrapper getWrapper(Object object);
49 }