public class ClosureInvokingDynamicMethod extends java.lang.Object implements DynamicMethodInvocation, StaticMethodInvocation, java.lang.Cloneable
Constructor and Description |
---|
ClosureInvokingDynamicMethod(java.lang.String pattern,
<any> closure) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invoke(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] arguments)
Invokes the actual method.
|
java.lang.Object |
invoke(java.lang.Object target,
java.lang.String methodName,
java.lang.Object[] arguments)
Invokes the actual method.
|
boolean |
isMethodMatch(java.lang.String methodName)
Checks if a method name matches the criteria of the implementation class.
|
public ClosureInvokingDynamicMethod(java.lang.String pattern, <any> closure)
public boolean isMethodMatch(java.lang.String methodName)
DynamicMethodInvocation
isMethodMatch
in interface DynamicMethodInvocation
isMethodMatch
in interface StaticMethodInvocation
methodName
- the static method namepublic java.lang.Object invoke(java.lang.Class clazz, java.lang.String methodName, java.lang.Object[] arguments)
StaticMethodInvocation
invoke
in interface StaticMethodInvocation
clazz
- the class the static method is called onmethodName
- the static method namearguments
- the arguments suppliedpublic java.lang.Object invoke(java.lang.Object target, java.lang.String methodName, java.lang.Object[] arguments)
DynamicMethodInvocation
invoke
in interface DynamicMethodInvocation
target
- the target on which the method is invoked.arguments
- the arguments passed in the method call @return the return value of the dynamic method invocation.