public class IndyInterface extends Object
| Constructor and Description |
|---|
IndyInterface() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.invoke.CallSite |
bootstrap(java.lang.invoke.MethodHandles.Lookup caller,
String name,
java.lang.invoke.MethodType type)
bootstrap method for standard method calls
|
static java.lang.invoke.CallSite |
bootstrapCurrent(java.lang.invoke.MethodHandles.Lookup caller,
String name,
java.lang.invoke.MethodType type)
bootstrap method for method calls with "this" as receiver
|
static java.lang.invoke.CallSite |
bootstrapCurrentSafe(java.lang.invoke.MethodHandles.Lookup caller,
String name,
java.lang.invoke.MethodType type) |
static java.lang.invoke.CallSite |
bootstrapSafe(java.lang.invoke.MethodHandles.Lookup caller,
String name,
java.lang.invoke.MethodType type)
bootstrap method for null safe standard method calls
|
static Object |
coerceToBigInt(Object o)
Converts an Object to BigInteger.
|
static Object |
coerceToByte(Object o)
Converts a Number to Byte.
|
static String |
coerceToString(Object o)
Converts an Object to String.
|
static Object |
invokeGroovyObjectInvoker(MissingMethodException e,
Object receiver,
String name,
Object[] args)
GroovyObject.invokeMethod(String, Object) path as fallback. |
static boolean |
isNotNull(Object o)
Guard to check if the argument is not null.
|
static boolean |
isNull(Object o)
Guard to check if the argument is null.
|
static boolean |
isSameMetaClass(MetaClass mc,
Object receiver)
called by handle
|
static boolean |
sameClass(Class c,
Object o)
Guard to check if the provided Object has the same
class as the provided Class.
|
static Object |
selectMethod(java.lang.invoke.MutableCallSite callSite,
Class sender,
String methodName,
Boolean safeNavigation,
Boolean thisCall,
Object dummyReceiver,
Object[] arguments)
Core method for indy method selection using runtime types.
|
static Object |
unwrap(GroovyRuntimeException gre)
Unwraps a
GroovyRuntimeException. |
static Object |
unwrap(Object o)
Unwraps a
Wrapper. |
public static java.lang.invoke.CallSite bootstrapCurrent(java.lang.invoke.MethodHandles.Lookup caller, String name, java.lang.invoke.MethodType type)
public static java.lang.invoke.CallSite bootstrapCurrentSafe(java.lang.invoke.MethodHandles.Lookup caller, String name, java.lang.invoke.MethodType type)
public static java.lang.invoke.CallSite bootstrap(java.lang.invoke.MethodHandles.Lookup caller, String name, java.lang.invoke.MethodType type)
public static java.lang.invoke.CallSite bootstrapSafe(java.lang.invoke.MethodHandles.Lookup caller, String name, java.lang.invoke.MethodType type)
public static Object invokeGroovyObjectInvoker(MissingMethodException e, Object receiver, String name, Object[] args)
GroovyObject.invokeMethod(String, Object) path as fallback.
This method is called by the handle as exception handler in case the
selected method causes a MissingMethodExecutionFailed, where
we will just give through the exception, and a normal
MissingMethodException where we call GroovyObject.invokeMethod(String, Object)
if receiver class, the type transported by the exception and the name
for the method stored in the exception and our current method name
are equal.
Should those conditions not apply we just rethrow the exception.public static Object unwrap(GroovyRuntimeException gre) throws Throwable
GroovyRuntimeException.
This method is called by the handle to unwrap internal exceptions
of the runtime.Throwablepublic static boolean isSameMetaClass(MetaClass mc, Object receiver)
public static Object unwrap(Object o)
Wrapper.
This method is called by the handle to unwrap a Wrapper, which
we use to force method selection.public static String coerceToString(Object o)
public static Object coerceToByte(Object o)
public static Object coerceToBigInt(Object o)
String.valueOf(Object)public static boolean isNull(Object o)
public static boolean isNotNull(Object o)
public static boolean sameClass(Class c, Object o)
public static Object selectMethod(java.lang.invoke.MutableCallSite callSite, Class sender, String methodName, Boolean safeNavigation, Boolean thisCall, Object dummyReceiver, Object[] arguments) throws Throwable
Throwable