Package org.fest.reflect.method

Provides a "fluent" API for method invocation 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.*;

   // Equivalent to call 'person.setName("Luke")'
   method("setName").withParameterTypes(String.class)
                    .in(person)
                    .invoke("Luke");
 
   // Equivalent to call 'person.concentrate()'
   method("concentrate").in(person).invoke();
   
   // Equivalent to call 'person.getName()'
   String name = method("getName").withReturnType(String.class)
                                  .in(person)
                                  .invoke();   

   // Equivalent to call 'Jedi.class.setCommonPower("Jump")'
   staticMethod("setCommonPower").withParameterTypes(String.class)
                                 .in(Jedi.class)
                                 .invoke("Jump");

   // Equivalent to call 'Jedi.class.addPadawan()'
   staticMethod("addPadawan").in(Jedi.class).invoke();

   // Equivalent to call 'Jedi.class.commonPowerCount()'
   String name = staticMethod("commonPowerCount").withReturnType(String.class)
                                                 .in(Jedi.class)
                                                 .invoke();