io.sarl.lang.util
Class ReflectMethod<RT, T>
Type Parameters:
RT - the type of the receiver.
T - the type of the returned value.
final class ReflectMethod<RT, T>
extends java.lang.Object
Utility class for accessing to a method by reflection.
Parameters:
<RT> - the type of the receiver.
<T> - the type of the returned value.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.8
Constructor Summary
Constructor and description
new(Class<T>,Class<T>,String)
Constructor.
Action Summary
Modifier and type Action and description
T invoke(RT,Object*)
Invoke the method.
static ReflectMethod<RT,T> of(Class<T>,Class<T>,String)
Static constructor.
Constructor Details
new(Class<T>,Class<T>,String)
protected new(Class<T>,Class<T>,String)
Constructor.
Parameters:
receiverType - the type of the receiver.
returnType - the type of the returned values.
methodName - the name of the method.
Action Details
invoke(RT,Object*)
def invoke(RT,Object*) : T
Invoke the method.
Parameters:
receiver - the receiver, never null.
arguments - the arguments.
Returns:
the result of the invocation.
of(Class<T>,Class<T>,String)
def of(Class<T>,Class<T>,String) : ReflectMethod<RT,T>

with RT, T

Static constructor.
Parameters:
<RT> - the type of the receiver.
<T> - the type of the returned value.
receiverType - the type of the receiver.
returnType - the type of the returned values.
methodName - the name of the method.
Returns:
the instance.