|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.groovy.grails.commons.metaclass.ClosureInvokingDynamicMethod
public class ClosureInvokingDynamicMethod
An implementation of DynamicMethodInvocation that invoces a closure
| Constructor Summary | |
|---|---|
ClosureInvokingDynamicMethod(String pattern,
groovy.lang.Closure closure)
|
|
| Method Summary | |
|---|---|
protected 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 |
Object |
invoke(Class clazz,
String methodName,
Object[] arguments)
Invokes the actual method. |
Object |
invoke(Object target,
String methodName,
Object[] arguments)
Invokes the actual method. |
boolean |
isMethodMatch(String methodName)
Checks if a method name matches the criteria of the implementation class. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClosureInvokingDynamicMethod(String pattern,
groovy.lang.Closure closure)
| Method Detail |
|---|
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic boolean isMethodMatch(String methodName)
DynamicMethodInvocationChecks if a method name matches the criteria of the implementation class.
isMethodMatch in interface DynamicMethodInvocationisMethodMatch in interface StaticMethodInvocationmethodName - the static method name
public Object invoke(Class clazz,
String methodName,
Object[] arguments)
StaticMethodInvocationInvokes the actual method. The class, method name and arguments are provided. If no arguments are passed the argument array is empty.
invoke in interface StaticMethodInvocationclazz - the class the static method is called onmethodName - the static method namearguments - the arguments supplied
public Object invoke(Object target,
String methodName,
Object[] arguments)
DynamicMethodInvocationInvokes the actual method. The target object and arguments are supplied.
invoke 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||