Package: org.codehaus.groovy.vmplugin.v8

## [Java] Class Selector

- org.codehaus.groovy.vmplugin.v8.Selector

-     public abstract class Selector
      extends Object

  Base state holder for invokedynamic method, property, constructor, and cast selection.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `Object[]` | `args` | Effective invocation arguments, possibly after spread-call normalization.
    `CacheableCallSite` | `callSite` | Call site being linked.
    `IndyInterface.CallType` | `callType` | Call-site category associated with this selector.
    `boolean` | `catchException` | Controls whether Groovy runtime exceptions are unwrapped around the target.
    `MethodHandle` | `handle` | Method handle assembled for the current dispatch path.
    `boolean` | `isVargs` | Indicates whether the selected target accepts varargs.
    `MetaMethod` | `method` | Selected meta method, when method dispatch resolves through the metaclass.
    `String` | `name` | Name of the method or property being resolved.
    `boolean` | `safeNavigation` | Flags tracking safe navigation and spread-call semantics.
    `Class<?>` | `selectionBase` | Class used as the selection base for metaclass lookups.
    `Class<?>` | `sender` | Sending class used for visibility and MOP decisions.
    `boolean` | `skipSpreadCollector` | Indicates whether spread-collector adaptation should be skipped.
    `MethodType` | `targetType` | Call-site target type and the currently adapted working type.
    `boolean` | `thisCall` | Indicates whether the invocation is a `this` call.
    `boolean` | `useMetaClass` | Flags controlling metaclass fallback usage and call-site caching.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `getCorrectedReceiver()` Returns NullObject.getNullObject if the receiver (args[0]) is null.
    `` | `public static Selector` | `getSelector(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, boolean safeNavigation, boolean thisCall, boolean spreadCall, Object[] arguments)` Returns a Selector or throws a GroovyBugError.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public Object[] args

      Effective invocation arguments, possibly after spread-call normalization.

    - #### public CacheableCallSite callSite

      Call site being linked.

    - #### public IndyInterface.CallType callType

      Call-site category associated with this selector.

    - #### public boolean catchException

      Controls whether Groovy runtime exceptions are unwrapped around the target.

    - #### public MethodHandle handle

      Method handle assembled for the current dispatch path.

    - #### public boolean isVargs

      Indicates whether the selected target accepts varargs.

    - #### public MetaMethod method

      Selected meta method, when method dispatch resolves through the metaclass.

    - #### public String name

      Name of the method or property being resolved.

    - #### public boolean safeNavigation

      Flags tracking safe navigation and spread-call semantics.

    - #### public Class<?> selectionBase

      Class used as the selection base for metaclass lookups.

    - #### public Class<?> sender

      Sending class used for visibility and MOP decisions.

    - #### public boolean skipSpreadCollector

      Indicates whether spread-collector adaptation should be skipped.

    - #### public MethodType targetType

      Call-site target type and the currently adapted working type.

    - #### public boolean thisCall

      Indicates whether the invocation is a `this` call.

    - #### public boolean useMetaClass

      Flags controlling metaclass fallback usage and call-site caching.

  - ### Method Detail

    - #### public Object getCorrectedReceiver()

      Returns NullObject.getNullObject if the receiver (args[0]) is null. If it is not null, the receiver itself is returned.

    - #### public static Selector getSelector(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, boolean safeNavigation, boolean thisCall, boolean spreadCall, Object[] arguments)

      Returns a Selector or throws a GroovyBugError.