See: Description
| Class | Description |
|---|---|
| DecoratedInvoker<T> |
A decorated invoker allowing to ignore some exceptions or returning decorator result instead of field result.
|
| FieldName |
Understands the name of a field to access using Java Reflection.
|
| FieldType<T> |
Understands the type of a field to access using Java Reflection.
|
| FieldTypeRef<T> |
Understands the type of a field to access using Java Reflection.
|
| Invoker<T> |
Understands the use of reflection to access a field from an object.
|
| StaticFieldName |
Understands the name of a static field to access using Java Reflection.
|
| StaticFieldType<T> |
Understands the type of a static field to access using Java Reflection.
|
| StaticFieldTypeRef<T> |
Understands the type of a static field to access using Java Reflection.
|
Provides a "fluent" API for field access via the Java Reflection API.
Note: Classes in this package are not intended to be used directly. To use them, you need to use the
class .
org.fest.reflect.core.Reflection
Here are some examples:
// import staticorg.fest.reflect.core.Reflection.*; // Retrieves the value of the field "name" String name =field("name").ofType(String.class).in(person).get(); // Sets the value of the field "name" to "Yoda"field("name").ofType(String.class).in(person).set("Yoda"); // Retrieves the value of the static field "count" int count =staticField("count").ofType(int.class).in(Person.class).get(); // Sets the value of the static field "count" to 3field("count").ofType(int.class).in(Person.class).set(3);
Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.