1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.beanutils;
19
20
21
22
23
24 /**
25 * <p>A <strong>DynaClass</strong> is a simulation of the functionality of
26 * <code>java.lang.Class</code> for classes implementing the
27 * <code>DynaBean</code> interface. DynaBean instances that share the same
28 * DynaClass all have the same set of available properties, along with any
29 * associated data types, read-only states, and write-only states.</p>
30 *
31 * @author Craig McClanahan
32 * @author Michael Smith
33 * @author Paulo Gaspar
34 * @version $Revision: 1.12 $ $Date: 2004/02/28 13:18:33 $
35 */
36
37 public interface DynaClass {
38
39
40 /**
41 * Return the name of this DynaClass (analogous to the
42 * <code>getName()</code> method of <code>java.lang.Class</code), which
43 * allows the same <code>DynaClass</code> implementation class to support
44 * different dynamic classes, with different sets of properties.
45 */
46 public String getName();
47
48
49 /**
50 * Return a property descriptor for the specified property, if it exists;
51 * otherwise, return <code>null</code>.
52 *
53 * @param name Name of the dynamic property for which a descriptor
54 * is requested
55 *
56 * @exception IllegalArgumentException if no property name is specified
57 */
58 public DynaProperty getDynaProperty(String name);
59
60
61 /**
62 * <p>Return an array of <code>ProperyDescriptors</code> for the properties
63 * currently defined in this DynaClass. If no properties are defined, a
64 * zero-length array will be returned.</p>
65 *
66 * <p><strong>FIXME</strong> - Should we really be implementing
67 * <code>getBeanInfo()</code> instead, which returns property descriptors
68 * and a bunch of other stuff?</p>
69 */
70 public DynaProperty[] getDynaProperties();
71
72
73 /**
74 * Instantiate and return a new DynaBean instance, associated
75 * with this DynaClass.
76 *
77 * @exception IllegalAccessException if the Class or the appropriate
78 * constructor is not accessible
79 * @exception InstantiationException if this Class represents an abstract
80 * class, an array class, a primitive type, or void; or if instantiation
81 * fails for some other reason
82 */
83 public DynaBean newInstance()
84 throws IllegalAccessException, InstantiationException;
85
86
87 }