KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > cojen > util > BeanProperty


1 /*
2  * Copyright 2004 Brian S O'Neill
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.cojen.util;
18
19 import java.lang.reflect.Method JavaDoc;
20
21 /**
22  * Contains information regarding a Bean property.
23  *
24  * @author Brian S O'Neill
25  * @see BeanIntrospector
26  */

27 public interface BeanProperty {
28     /**
29      * Returns the name of this property.
30      */

31     String JavaDoc getName();
32
33     /**
34      * Returns the type of this property.
35      */

36     Class JavaDoc getType();
37
38     /**
39      * Returns a no-arg method used to read the property value, or null if
40      * reading is not allowed. The return type matches the type of this
41      * property.
42      */

43     Method JavaDoc getReadMethod();
44
45     /**
46      * Returns a one argument method used to write the property value, or null
47      * if writing is not allowed. The first argument is the value to set, which
48      * is the type of this property.
49      */

50     Method JavaDoc getWriteMethod();
51
52     /**
53      * Returns the count of index types supported by this property.
54      */

55     int getIndexTypesCount();
56
57     /**
58      * Returns a specific index type supported by this property.
59      */

60     Class JavaDoc getIndexType(int index) throws IndexOutOfBoundsException JavaDoc;
61
62     /**
63      * Returns a one argument method used to read the indexed property value,
64      * or null if indexed reading is not allowed. The first argument on the
65      * returned method is the index value.
66      */

67     Method JavaDoc getIndexedReadMethod(int index) throws IndexOutOfBoundsException JavaDoc;
68
69     /**
70      * Returns a two argument method used to write the indexed property value,
71      * or null if indexed writing is not allowed. The first argument on the
72      * returned method is the index value. The second argument is the indexed
73      * value to set, which is the type of this property.
74      */

75     Method JavaDoc getIndexedWriteMethod(int index) throws IndexOutOfBoundsException JavaDoc;
76
77     String JavaDoc toString();
78 }
79
Popular Tags