1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.onemind.commons.relabean;
22
23 import java.beans.IntrospectionException;
24 import java.io.IOException;
25 import java.io.Writer;
26 import java.lang.reflect.Method;
27 /***
28 * A default extension to Sun's bean property descriptor
29 * @author TiongHiang Lee (thlee@onemindsoft.org)
30 * @version $Id: PropertyDescriptor.java,v 1.2 2004/08/26 16:28:58 thlee Exp $ $Name: $
31 */
32 public final class PropertyDescriptor extends java.beans.PropertyDescriptor
33 {
34
35 /***
36 * {@inheritDoc}
37 */
38 public PropertyDescriptor(String propertyName, Class beanClass)
39 throws IntrospectionException
40 {
41 super(propertyName, beanClass);
42 }
43
44 /***
45 * {@inheritDoc}
46 */
47 public PropertyDescriptor(String propertyName, Method getter, Method setter)
48 throws IntrospectionException
49 {
50 super(propertyName, getter, setter);
51 }
52
53 /***
54 * {@inheritDoc}
55 */
56 public PropertyDescriptor(String propertyName, Class beanClass,
57 String getterName, String setterName) throws IntrospectionException
58 {
59 super(propertyName, beanClass, getterName, setterName);
60 }
61
62 /***
63 * Dump the property
64 * @param prefix the prefix
65 * @param writer the writer
66 * @throws IOException if there's IO problem
67 */
68 public final void dump(String prefix, Writer writer) throws IOException
69 {
70 writer.write(prefix + "Property name: " + getName() + "\n");
71 writer.write(prefix + "\ttype: " + getPropertyType() + "\n");
72 writer.write(prefix + "\treadMethod: " + getReadMethod() + "\n");
73 writer.write(prefix + "\twriteMethod: " + getWriteMethod() + "\n");
74 }
75 }