Package org.fest.reflect.field


package org.fest.reflect.field

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);

  • Classes
    Class
    Description
    A decorated invoker allowing to ignore some exceptions or returning decorator result instead of field result.
    Understands the name of a field to access using Java Reflection.
    Understands the type of a field to access using Java Reflection.
    Understands the type of a field to access using Java Reflection.
    Understands the use of reflection to access a field from an object.
    Understands the name of a static field to access using Java Reflection.
    Understands the type of a static field to access using Java Reflection.
    Understands the type of a static field to access using Java Reflection.