1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jxpath;
17
18 import java.beans.PropertyDescriptor;
19
20 /***
21 * JXPathBeanInfo is similar to java.beans.BeanInfo in that it describes
22 * properties of a JavaBean class. By default, JXPathBeanInfo classes are
23 * automatically generated by {@link JXPathIntrospector JXPathIntrospector}
24 * based on the java.beans.BeanInfo. As with JavaBeans, the user can supply an
25 * alternative implementation of JXPathBeanInfo for a custom class. The
26 * alternative implementation is located by class name, which is the same as the
27 * name of the class it represents with the suffix "XBeanInfo". So, for
28 * example, if you need to provide an alternative JXPathBeanInfo class for class
29 * "com.foo.Bar", write a class "com.foo.BarXBeanInfo" and make it implement the
30 * JXPathBeanInfo interface.
31 *
32 * @author Dmitri Plotnikov
33 * @version $Revision: 1.7 $ $Date: 2004/02/29 14:17:42 $
34 */
35 public interface JXPathBeanInfo {
36
37 /***
38 * Returns true if objects of this class are treated as atomic
39 * objects which have no properties of their own.
40 * For example, java.lang.String and java.lang.Number are atomic.
41 */
42 boolean isAtomic();
43
44 /***
45 * Returns true if the objects of this class have dynamic properties
46 * (e.g. java.util.Map). If this method returns true, getPropertyDescriptors
47 * should return null and getDynamicPropertyHandlerClass should return
48 * a valid class name. An object cannot have both static and dynamic
49 * properties at the same time.
50 */
51 boolean isDynamic();
52
53 /***
54 * Returns a list of property descriptors for the beans described by this
55 * bean info object. Returns null for atomic beans.
56 */
57 PropertyDescriptor[] getPropertyDescriptors();
58
59 /***
60 * Returns a PropertyDescriptor for the specified name or null if there
61 * is no such property.
62 */
63 PropertyDescriptor getPropertyDescriptor(String propertyName);
64
65 /***
66 * For dynamic objects, returns the class implementing
67 * the DynamicPropertyHandler interface. That class can
68 * be used to access dynamic properties.
69 */
70 Class getDynamicPropertyHandlerClass();
71 }