java.beans
public class IndexedPropertyDescriptor extends PropertyDescriptor
An example property would have four methods like this:
FooBar[] getFoo()
void setFoo(FooBar[])
FooBar getFoo(int)
void setFoo(int,FooBar)
The constraints put on get and set methods are:
<propertyType>[] <getMethodName>()
void <setMethodName>(<propertyType>[])
<propertyType> <getMethodName>(int)
void <setMethodName>(int,<propertyType>)
Since: JDK1.1
Constructor Summary | |
---|---|
IndexedPropertyDescriptor(String name, Class<?> beanClass)
Create a new IndexedPropertyDescriptor by introspection.
| |
IndexedPropertyDescriptor(String name, Class<?> beanClass, String getMethodName, String setMethodName, String getIndexName, String setIndexName)
Create a new IndexedPropertyDescriptor by introspection.
| |
IndexedPropertyDescriptor(String name, Method getMethod, Method setMethod, Method getIndex, Method setIndex)
Create a new PropertyDescriptor using explicit Methods.
|
Method Summary | |
---|---|
Class<?> | getIndexedPropertyType() |
Method | getIndexedReadMethod() |
Method | getIndexedWriteMethod() |
void | setIndexedReadMethod(Method m)
Sets the method that is used to read an indexed property.
|
void | setIndexedWriteMethod(Method m)
Sets the method that is used to write an indexed property.
|
get<name>()
and setter methods named
set<name>()
in class
<beanClass>
, where <name> has its
first letter capitalized by the constructor.Implementation note: If there is a get(int) method, then the return type of that method is used to find the remaining methods. If there is no get method, then the set(int) method is searched for exhaustively and that type is used to find the others.
Spec note: If there is no get(int) method and multiple set(int) methods with the same name and the correct parameters (different type of course), then an IntrospectionException is thrown. While Sun's spec does not state this, it can make Bean behavior different on different systems (since method order is not guaranteed) and as such, can be treated as a bug in the spec. I am not aware of whether Sun's implementation catches this.
Parameters: name the programmatic name of the property, usually starting with a lowercase letter (e.g. fooManChu instead of FooManChu). beanClass the class the get and set methods live in.
Throws: IntrospectionException if the methods are not found or invalid.
Implementation note: If there is a get(int) method, then the return type of that method is used to find the remaining methods. If there is no get method, then the set(int) method is searched for exhaustively and that type is used to find the others.
Spec note: If there is no get(int) method and multiple set(int) methods with the same name and the correct parameters (different type of course), then an IntrospectionException is thrown. While Sun's spec does not state this, it can make Bean behavior different on different systems (since method order is not guaranteed) and as such, can be treated as a bug in the spec. I am not aware of whether Sun's implementation catches this.
Parameters: name the programmatic name of the property, usually starting with a lowercase letter (e.g. fooManChu instead of FooManChu). beanClass the class the get and set methods live in. getMethodName the name of the get array method. setMethodName the name of the set array method. getIndexName the name of the get index method. setIndexName the name of the set index method.
Throws: IntrospectionException if the methods are not found or invalid.
Parameters: name the programmatic name of the property, usually starting with a lowercase letter (e.g. fooManChu instead of FooManChu). getMethod the get array method. setMethod the set array method. getIndex the get index method. setIndex the set index method.
Throws: IntrospectionException if the methods are not found or invalid.
Parameters: m the method to set
Parameters: m the method to set