public class ClosureInvokingDynamicMethod extends java.lang.Object implements DynamicMethodInvocation, StaticMethodInvocation, java.lang.Cloneable
| Constructor and Description |
|---|
ClosureInvokingDynamicMethod(java.lang.String pattern,
groovy.lang.Closure<?> closure) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
clone()
For thread safety when using a ClosureInvokingDynamicMethod it should ALWAYS be cloned first
Weird behaviour will occur if a unique cloned instance is not used for each invocation
|
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,
groovy.lang.Closure<?> closure)
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic boolean isMethodMatch(java.lang.String methodName)
DynamicMethodInvocationisMethodMatch in interface DynamicMethodInvocationisMethodMatch in interface StaticMethodInvocationmethodName - the static method namepublic java.lang.Object invoke(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] arguments)
StaticMethodInvocationinvoke in interface StaticMethodInvocationclazz - 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)
DynamicMethodInvocationinvoke in interface DynamicMethodInvocationtarget - 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.