Package: org.codehaus.groovy.grails.commons.metaclass

## [Java] Class ClosureInvokingDynamicMethod

- org.codehaus.groovy.grails.commons.metaclass.ClosureInvokingDynamicMethod

- All Implemented Interfaces and Traits:
    DynamicMethodInvocation, StaticMethodInvocation, java.lang.Cloneable

      public class ClosureInvokingDynamicMethod
      extends java.lang.Object

  An implementation of DynamicMethodInvocation that invokes a closure.

  Authors:
    Graeme Rocher
  Since:
    0.4

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureInvokingDynamicMethod (java.lang.String pattern, groovy.lang.Closure<?> closure)`

  - ### Methods Summary

    Methods
    Type | Name 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)`
    `java.lang.Object` | `invoke(java.lang.Object target, java.lang.String methodName, java.lang.Object[] arguments)`
    `boolean` | `isMethodMatch(java.lang.String methodName)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### public ClosureInvokingDynamicMethod(java.lang.String pattern, groovy.lang.Closure<?> closure)

  - ### Method Detail

    - #### @java.lang.Override 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

      throws:
        CloneNotSupportedException
      Returns:
        A cloned instance

    - #### public java.lang.Object invoke(@java.lang.SuppressWarnings("rawtypes") java.lang.Class clazz, java.lang.String methodName, java.lang.Object[] arguments)

    - #### public java.lang.Object invoke(java.lang.Object target, java.lang.String methodName, java.lang.Object[] arguments)

    - #### public boolean isMethodMatch(java.lang.String methodName)