[Java] Class ConvertedMap
- org.codehaus.groovy.runtime.ConvertedMap
public class ConvertedMap extends ConversionHandler
This class is a general adapter to adapt a map of closures to any Java interface.
Constructor Summary
Constructor and description |
---|
protected ConvertedMap
(Map closures) to create a ConvertedMap object. |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
protected boolean |
checkMethod(Method method) | |
public Object |
invokeCustom(Object proxy, Method method, Object[] args) | |
public static boolean |
isCoreObjectMethod(Method method) Checks whether a method is a core method from java.lang.Object. | |
public String |
toString() |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class ConversionHandler | checkMethod, equals, getDelegate, hashCode, invoke, invokeCustom, isCoreObjectMethod, isDefaultMethod, toString |
Constructor Detail
protected ConvertedMap(Map closures)
to create a ConvertedMap object.
- Parameters:
-
closures
- the map of closures
Method Detail
@Override protected boolean checkMethod(Method method)
@Override public Object invokeCustom(Object proxy, Method method, Object[] args)
public static boolean isCoreObjectMethod(Method method)
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
- the method to check
- Returns:
- true if the method is deemed to be a core method
@Override public String toString()
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/runtime/ConvertedMap.html