org.codehaus.groovy.runtime
Class ConvertedClosure

java.lang.Object
  extended byorg.codehaus.groovy.runtime.ConversionHandler
      extended byorg.codehaus.groovy.runtime.ConvertedClosure
All Implemented Interfaces:
InvocationHandler

public class ConvertedClosure
extends ConversionHandler

This class is a general adapter to adapt a closure to any Java interface.

Author:
Ben Yu, Jochen Theodorou Jul 27, 2006 3:50:51 PM

Constructor Summary
protected ConvertedClosure(Closure closure)
          to create a ConvertedClosure object.
 
Method Summary
 Object invokeCustom(Object proxy, Method method, Object[] args)
          This method is called for all Methods not defined on Object.
 
Methods inherited from class org.codehaus.groovy.runtime.ConversionHandler
equals, getDelegate, hashCode, invoke, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConvertedClosure

protected ConvertedClosure(Closure closure)
to create a ConvertedClosure object.

Parameters:
closure - the closure object.
Method Detail

invokeCustom

public Object invokeCustom(Object proxy,
                           Method method,
                           Object[] args)
                    throws Throwable
Description copied from class: ConversionHandler
This method is called for all Methods not defined on Object. The delegate should be called here.

Specified by:
invokeCustom in class ConversionHandler
Parameters:
proxy - the proxy
method - the method
args - the arguments
Returns:
the result of the invocation of the delegate
Throws:
Throwable - any exception causes by the delegate
See Also:
ConversionHandler.invoke(Object, Method, Object[]), InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])


Copyright © 2003-2007 The Codehaus. All Rights Reserved.