Package org.codehaus.groovy.vmplugin.v8

# Class Selector

java.lang.Object
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
  Modifier and Type
  Field
  Description
  `Object[]`
  `args`
  Effective invocation arguments, possibly after spread-call normalization.
  `boolean`
  `cache`
  Flags controlling metaclass fallback usage and call-site caching.
  `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.
  `MethodType`
  `currentType`
  Call-site target type and the currently adapted working type.
  `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.
  `Object[]`
  `originalArguments`
  Effective invocation arguments, possibly after spread-call normalization.
  `boolean`
  `safeNavigation`
  Flags tracking safe navigation and spread-call semantics.
  `boolean`
  `safeNavigationOrig`
  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.
  `boolean`
  `spread`
  Flags tracking safe navigation and spread-call semantics.
  `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.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Selector()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getCorrectedReceiver()`
  Returns `NullObject.getNullObject()` if the receiver (args[0]) is null.
  `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.

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

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

- ## Field Details

  - ### args

    public Object[] args
    Effective invocation arguments, possibly after spread-call normalization.

  - ### originalArguments

    public Object[] originalArguments
    Effective invocation arguments, possibly after spread-call normalization.

  - ### method

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

  - ### targetType

    public MethodType targetType
    Call-site target type and the currently adapted working type.

  - ### currentType

    public MethodType currentType
    Call-site target type and the currently adapted working type.

  - ### name

    public String name
    Name of the method or property being resolved.

  - ### handle

    public MethodHandle handle
    Method handle assembled for the current dispatch path.

  - ### useMetaClass

    public boolean useMetaClass
    Flags controlling metaclass fallback usage and call-site caching.

  - ### cache

    public boolean cache
    Flags controlling metaclass fallback usage and call-site caching.

  - ### callSite

    public CacheableCallSite callSite
    Call site being linked.

  - ### sender

    public Class<?> sender
    Sending class used for visibility and MOP decisions.

  - ### isVargs

    public boolean isVargs
    Indicates whether the selected target accepts varargs.

  - ### safeNavigation

    public boolean safeNavigation
    Flags tracking safe navigation and spread-call semantics.

  - ### safeNavigationOrig

    public boolean safeNavigationOrig
    Flags tracking safe navigation and spread-call semantics.

  - ### spread

    public boolean spread
    Flags tracking safe navigation and spread-call semantics.

  - ### skipSpreadCollector

    public boolean skipSpreadCollector
    Indicates whether spread-collector adaptation should be skipped.

  - ### thisCall

    public boolean thisCall
    Indicates whether the invocation is a `this` call.

  - ### selectionBase

    public Class<?> selectionBase
    Class used as the selection base for metaclass lookups.

  - ### catchException

    public boolean catchException
    Controls whether Groovy runtime exceptions are unwrapped around the target.

  - ### callType

    public IndyInterface.CallType callType
    Call-site category associated with this selector.

- ## Constructor Details

  - ### Selector

    public Selector()

- ## Method Details

  - ### getSelector

    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.

  - ### getCorrectedReceiver

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