org.dynalang.mop.beans
Class DynamicMethod<T extends java.lang.reflect.Member>
java.lang.Object
org.dynalang.mop.beans.DynamicMethod<T>
- Type Parameters:
T
- the type of class members this dynamic method represents. It is
either Method
or Constructor
.
public abstract class DynamicMethod<T extends java.lang.reflect.Member>
- extends java.lang.Object
Represents a single dynamic method. A "dynamic" method is considered to be
the union of all methods of the same name on a class. In the simplest case,
it corresponds to a single method, but can actually represent any number of
methods if the method name is overloaded. Invoking a dynamic method whose
name is overloaded will perform overload resolution.
- Version:
- $Id: $
- Author:
- Attila Szegedi
Method Summary |
abstract java.lang.Object |
call(java.lang.Object target,
CallProtocol callProtocol,
java.lang.Object... args)
Invokes the dynamic method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynamicMethod
public DynamicMethod()
call
public abstract java.lang.Object call(java.lang.Object target,
CallProtocol callProtocol,
java.lang.Object... args)
- Invokes the dynamic method.
- Parameters:
target
- the target object -- the "this" of the invoked method, or
null for static methods.callProtocol
- the call protocol object used to convert arguments
if neededargs
- the arguments to the method. Note that you never need to
pack varargs into an array, nor need to be aware of the vararg concept
at all when using this API. If the called Java method ends up being a
vararg method, its varargs will be packed into an appropriate array
automatically.
- Returns:
- the result of the method invocation.