Top Description Fields Constructors Methods
org.codehaus.groovy.runtime

public Class ConvertedMap

extends ConversionHandler
Class Inheritance
Imports
groovy.lang.Closure, java.lang.reflect.Method, java.util.Map

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

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
ConvertedMap(Map<K, V>
the map of closures
closures
)

to create a ConvertedMap object.

Method Summary

Modifier and TypeMethod and Description
protected boolean
public Object
invokeCustom(Object
the proxy
proxy
,
Method
the method
method
,
Object[]
the arguments
args
)

Implements abstract org.codehaus.groovy.runtime.ConversionHandler.invokeCustom.

This method is called for all Methods not defined on Object.
public static boolean

Returns:

true if the method is deemed to be a core method
isCoreObjectMethod
(Method
the method to check
method
)

Hides org.codehaus.groovy.runtime.ConversionHandler.isCoreObjectMethod.

Checks whether a method is a core method from java.lang.Object.
public String
toString()

Overrides org.codehaus.groovy.runtime.ConversionHandler.toString.

Returns a String version of the delegate.
Inherited from org.codehaus.groovy.runtime.ConversionHandler:
equalsgetDelegatehashCodeinvokeisDefaultMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.codehaus.groovy.runtime.ConversionHandler.serialVersionUID.

Constructor Detail

ConvertedMapback to summary
protected ConvertedMap(Map<K, V> closures)

to create a ConvertedMap object.

Parameters
closures:Map<K, V>

the map of closures

Method Detail

checkMethodback to summary
protected boolean checkMethod(Method method)

Overrides org.codehaus.groovy.runtime.ConversionHandler.checkMethod.

Annotations
@Override
invokeCustomback to summary
public Object invokeCustom(Object proxy, Method method, Object[] args) throws Throwable

Implements abstract org.codehaus.groovy.runtime.ConversionHandler.invokeCustom.

Doc from org.codehaus.groovy.runtime.ConversionHandler.invokeCustom.

This method is called for all Methods not defined on Object. The delegate should be called here.

Parameters
proxy:Object

the proxy

method:Method

the method

args:Object[]

the arguments

Returns:Object

the result of the invocation of the delegate

Annotations
@Override
Exceptions
Throwable:
any exception causes by the delegate
isCoreObjectMethodback to summary
public static boolean isCoreObjectMethod(Method method)

Hides org.codehaus.groovy.runtime.ConversionHandler.isCoreObjectMethod.

Checks whether a method is a core method from java.lang.Object. Such methods often receive special treatment because they are deemed fundamental enough to not be tampered with. call toString() is an exception to allow overriding toString() by a closure specified in the map

Parameters
method:Method

the method to check

Returns:boolean

true if the method is deemed to be a core method

toStringback to summary
public String toString()

Overrides org.codehaus.groovy.runtime.ConversionHandler.toString.

Doc from org.codehaus.groovy.runtime.ConversionHandler.toString.

Returns a String version of the delegate.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override