r01f.reflection.fluent
Class StaticMethodParameterTypes<T>

java.lang.Object
  extended by r01f.reflection.fluent.StaticMethodParameterTypes<T>
Type Parameters:
T - the generic type of the static method's return type. Usage example:
   // Equivalent to call 'Jedi.setCommonPower("Jump")'
   Reflection.staticMethod("setCommonPower").withParameterTypes(String.class).in(Jedi.class).invoke("Jump");
 
   // Equivalent to call 'Jedi.addPadawan()'
   Reflection.staticMethod("addPadawan").in(Jedi.class).invoke();
 
   // Equivalent to call 'Jedi.commonPowerCount()'
   String name = Reflection.staticMethod("commonPowerCount").withReturnType(String.class).in(Jedi.class).invoke();
 
   // Equivalent to call 'Jedi.getCommonPowers()'
   List powers = Reflection.staticMethod("getCommonPowers").withReturnType(new TypeRef>() {}).in(Jedi.class).invoke();
 

public final class StaticMethodParameterTypes<T>
extends java.lang.Object

Parameter types of the static method to invoke.


Field Summary
private  java.lang.String _methodName
           
private  java.lang.Class<?>[] _parameterTypes
           
 
Constructor Summary
private StaticMethodParameterTypes(java.lang.String methodName, java.lang.Class<?>[] parameterTypes)
           
 
Method Summary
 MethodInvoker<T> in(java.lang.Class<?> target)
          Creates a new method invoker.
(package private) static
<T> StaticMethodParameterTypes<T>
newParameterTypes(java.lang.String methodName, java.lang.Class<?>[] parameterTypes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_methodName

private final java.lang.String _methodName

_parameterTypes

private final java.lang.Class<?>[] _parameterTypes
Constructor Detail

StaticMethodParameterTypes

private StaticMethodParameterTypes(java.lang.String methodName,
                                   java.lang.Class<?>[] parameterTypes)
Method Detail

newParameterTypes

static <T> StaticMethodParameterTypes<T> newParameterTypes(java.lang.String methodName,
                                                           java.lang.Class<?>[] parameterTypes)

in

public MethodInvoker<T> in(java.lang.Class<?> target)
Creates a new method invoker.

Parameters:
target - the class containing the static method to invoke.
Returns:
the created method invoker.
Throws:
java.lang.NullPointerException - if the given target is null.