|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Object
CloneNotSupportedException
public boolean isMethodMatch(String methodName)
DynamicMethodInvocation
Checks if a method name matches the criteria of the implementation class.
isMethodMatch
in interface DynamicMethodInvocation
isMethodMatch
in interface StaticMethodInvocation
methodName
- the static method name
public Object invoke(Class clazz, String methodName, Object[] arguments)
StaticMethodInvocation
Invokes the actual method. The class, method name and arguments are provided. If no arguments are passed the argument array is empty.
invoke
in interface StaticMethodInvocation
clazz
- the class the static method is called onmethodName
- the static method namearguments
- the arguments supplied
public Object invoke(Object target, String methodName, Object[] arguments)
DynamicMethodInvocation
Invokes the actual method. The target object and arguments are supplied.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |