Package org.fest.reflect.field

Provides a "fluent" API for field access via the Java Reflection API.

See:
          Description

Class Summary
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.
 

Package org.fest.reflect.field Description

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 static org.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 3
   field("count").ofType(int.class).in(Person.class).set(3);



Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.