IndyGuardsFiltersAndSignatures (Groovy 2.4.5)
Date: 2015-09-17

org.codehaus.groovy.vmplugin.v7

## Class IndyGuardsFiltersAndSignatures

- java.lang.Object
- - org.codehaus.groovy.vmplugin.v7.IndyGuardsFiltersAndSignatures

-     public class IndyGuardsFiltersAndSignatures
      extends Object

  This class contains guards, runtime filters and MethodType signatures used by indy.
  Author:
    Jochen "blackdrag" Theodorou

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static MethodHandle` | `ARRAYLIST_CONSTRUCTOR`
    `protected static MethodHandle` | `BEAN_CONSTRUCTOR_PROPERTY_SETTER`
    `protected static MethodHandle` | `BOOLEAN_IDENTITY`
    `protected static MethodHandle` | `CLASS_FOR_NAME`
    `protected static MethodHandle` | `DTT_CAST_TO_TYPE`
    `protected static MethodHandle` | `EQUALS`
    `protected static MethodHandle` | `GROOVY_CAST_EXCEPTION`
    `protected static MethodHandle` | `GROOVY_OBJECT_GET_PROPERTY`
    `protected static MethodHandle` | `GROOVY_OBJECT_INVOKER`
    `protected static MethodHandle` | `HAS_CATEGORY_IN_CURRENT_THREAD_GUARD`
    `protected static MethodHandle` | `HASHSET_CONSTRUCTOR`
    `protected static MethodHandle` | `INTERCEPTABLE_INVOKER`
    `protected static MethodHandle` | `IS_NULL`
    `protected static MethodHandle` | `META_CLASS_INVOKE_STATIC_METHOD`
    `protected static MethodHandle` | `META_METHOD_INVOKER`
    `protected static MethodHandle` | `META_PROPERTY_GETTER`
    `protected static MethodHandle` | `MOP_GET`
    `protected static MethodHandle` | `MOP_INVOKE_CONSTRUCTOR`
    `protected static MethodHandle` | `MOP_INVOKE_METHOD`
    `protected static MethodHandle` | `NULL_REF`
    `protected static MethodHandle` | `SAM_CONVERSION`
    `protected static MethodHandle` | `SAME_CLASS`
    `protected static MethodHandle` | `SAME_MC`
    `protected static MethodHandle` | `SLOW_META_CLASS_FIND`
    `protected static MethodHandle` | `UNWRAP_EXCEPTION`
    `protected static MethodHandle` | `UNWRAP_METHOD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndyGuardsFiltersAndSignatures()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Object` | `invokeGroovyObjectInvoker(MissingMethodException e, Object receiver, String name, Object[] args)` `GroovyObject.invokeMethod(String, Object)` path as fallback.
    `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` | `setBeanProperties(MetaClass mc, Object bean, Map properties)` This method is called by he handle to realize the bean constructor with property map.
    `static Object` | `unwrap(GroovyRuntimeException gre)` Unwraps a `GroovyRuntimeException`.
    `static Object` | `unwrap(Object o)` Unwraps a `Wrapper`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SAME_CLASS

          protected static final MethodHandle SAME_CLASS

    - #### UNWRAP_METHOD

          protected static final MethodHandle UNWRAP_METHOD

    - #### SAME_MC

          protected static final MethodHandle SAME_MC

    - #### IS_NULL

          protected static final MethodHandle IS_NULL

    - #### UNWRAP_EXCEPTION

          protected static final MethodHandle UNWRAP_EXCEPTION

    - #### META_METHOD_INVOKER

          protected static final MethodHandle META_METHOD_INVOKER

    - #### GROOVY_OBJECT_INVOKER

          protected static final MethodHandle GROOVY_OBJECT_INVOKER

    - #### GROOVY_OBJECT_GET_PROPERTY

          protected static final MethodHandle GROOVY_OBJECT_GET_PROPERTY

    - #### HAS_CATEGORY_IN_CURRENT_THREAD_GUARD

          protected static final MethodHandle HAS_CATEGORY_IN_CURRENT_THREAD_GUARD

    - #### BEAN_CONSTRUCTOR_PROPERTY_SETTER

          protected static final MethodHandle BEAN_CONSTRUCTOR_PROPERTY_SETTER

    - #### META_PROPERTY_GETTER

          protected static final MethodHandle META_PROPERTY_GETTER

    - #### SLOW_META_CLASS_FIND

          protected static final MethodHandle SLOW_META_CLASS_FIND

    - #### META_CLASS_INVOKE_STATIC_METHOD

          protected static final MethodHandle META_CLASS_INVOKE_STATIC_METHOD

    - #### MOP_GET

          protected static final MethodHandle MOP_GET

    - #### MOP_INVOKE_CONSTRUCTOR

          protected static final MethodHandle MOP_INVOKE_CONSTRUCTOR

    - #### MOP_INVOKE_METHOD

          protected static final MethodHandle MOP_INVOKE_METHOD

    - #### INTERCEPTABLE_INVOKER

          protected static final MethodHandle INTERCEPTABLE_INVOKER

    - #### CLASS_FOR_NAME

          protected static final MethodHandle CLASS_FOR_NAME

    - #### BOOLEAN_IDENTITY

          protected static final MethodHandle BOOLEAN_IDENTITY

    - #### DTT_CAST_TO_TYPE

          protected static final MethodHandle DTT_CAST_TO_TYPE

    - #### SAM_CONVERSION

          protected static final MethodHandle SAM_CONVERSION

    - #### HASHSET_CONSTRUCTOR

          protected static final MethodHandle HASHSET_CONSTRUCTOR

    - #### ARRAYLIST_CONSTRUCTOR

          protected static final MethodHandle ARRAYLIST_CONSTRUCTOR

    - #### GROOVY_CAST_EXCEPTION

          protected static final MethodHandle GROOVY_CAST_EXCEPTION

    - #### EQUALS

          protected static final MethodHandle EQUALS

    - #### NULL_REF

          protected static final MethodHandle NULL_REF

  - ### Constructor Detail

    - #### IndyGuardsFiltersAndSignatures

          public IndyGuardsFiltersAndSignatures()

  - ### Method Detail

    - #### setBeanProperties

          public static Object setBeanProperties(MetaClass mc,
                                 Object bean,
                                 Map properties)

      This method is called by he handle to realize the bean constructor with property map.

    - #### invokeGroovyObjectInvoker

          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.

    - #### unwrap

          public static Object unwrap(GroovyRuntimeException gre)
                               throws Throwable

      Unwraps a `GroovyRuntimeException`. This method is called by the handle to unwrap internal exceptions of the runtime.
      Throws:
        `Throwable`

    - #### isSameMetaClass

          public static boolean isSameMetaClass(MetaClass mc,
                                Object receiver)

      called by handle

    - #### unwrap

          public static Object unwrap(Object o)

      Unwraps a `Wrapper`. This method is called by the handle to unwrap a Wrapper, which we use to force method selection.

    - #### isNull

          public static boolean isNull(Object o)

      Guard to check if the argument is null. This method is called by the handle to check if the provided argument is null.

    - #### sameClass

          public static boolean sameClass(Class c,
                          Object o)

      Guard to check if the provided Object has the same class as the provided Class. This method will return false if the Object is null.