|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.reflect.beanproperty.Invoker<T>
T
- the declared type for the property to access.public final class Invoker<T>
Understands the use of instrospection to access a property from a JavaBean.
The following is an example of proper usage of this class:
// Retrieves the value of the property "name" String name =property
("name").ofType
(String.class).in
(person).get
(); // Sets the value of the property "name" to "Yoda"property
("name").ofType
(String.class).in
(person).set
("Yoda"); // Retrieves the value of the static property "count" int count =staticField
("count").ofType
(int.class).in
(Person.class).get
(); // Sets the value of the static property "count" to 3property
("count").ofType
(int.class).in
(Person.class).set
(3);
Method Summary | |
---|---|
T |
get()
Returns the value of the property managed by this class. |
PropertyDescriptor |
info()
Returns the "real" property managed by this class. |
void |
set(T value)
Sets a value in the property managed by this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void set(T value)
value
- the value to set.
ReflectionError
- if the given value cannot be set.public T get()
ReflectionError
- if the value of the property cannot be retrieved.public PropertyDescriptor info()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |