org.codehaus.groovy.runtime
Class ConvertedMap

java.lang.Object
  extended by org.codehaus.groovy.runtime.ConversionHandler
      extended by org.codehaus.groovy.runtime.ConvertedMap
All Implemented Interfaces:
InvocationHandler

public class ConvertedMap
extends ConversionHandler

This class is a general adapter to adapt a map of closures to any Java interface.

Author:
Jochen Theodorou

Constructor Summary
protected ConvertedMap(Map closures)
          to create a ConvertedMap object.
 
Method Summary
 Object invokeCustom(Object proxy, Method method, Object[] args)
          This method is called for all Methods not defined on Object.
 String toString()
          Returns a String version of the delegate.
 
Methods inherited from class org.codehaus.groovy.runtime.ConversionHandler
equals, getDelegate, hashCode, invoke, isCoreObjectMethod
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConvertedMap

protected ConvertedMap(Map closures)
to create a ConvertedMap object.

Parameters:
closures - the map of closres
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[])

toString

public String toString()
Description copied from class: ConversionHandler
Returns a String version of the delegate.

Overrides:
toString in class ConversionHandler
See Also:
Object.toString()

Copyright © 2003-2009 The Codehaus. All rights reserved.