Package org.spongepowered.asm.mixin.injection.selectors

## Interface ISelectorContext

- All Known Subinterfaces:
    `IInjectionPointContext`, `ISliceContext`
  All Known Implementing Classes:
    `AccessorInfo`, `AnnotatedMethodInfo`, `CallbackInjectionInfo`, `InjectionInfo`, `InjectionPointAnnotationContext`, `ModifyArgInjectionInfo`, `ModifyArgsInjectionInfo`, `ModifyConstantInjectionInfo`, `ModifyVariableInjectionInfo`, `RedirectInjectionInfo`, `SelectorAnnotationContext`, `SpecialMethodInfo`

      public interface ISelectorContext

  Context passed to a `Target Selector` in order to support context-sensitive behaviour for the selector. For example obtaining the name of the source mixin, or the element containing the selector itself.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IAnnotationHandle` | `getAnnotation()` | Get the root annotation for the selector, for example the injector or accessor annotation
    `java.lang.String` | `getElementDescription()` | Get a human-readable description of the annotation on the method for use in error messages
    `java.lang.Object` | `getMethod()` | Get the root method upon which this selector is operating, usually the injector method
    `IMixinContext` | `getMixin()` | Get the mixin containing this selector.
    `ISelectorContext` | `getParent()` | Get the parent (outer/containing) context.
    `IAnnotationHandle` | `getSelectorAnnotation()` | Get the annotation for this selector, for example the @At annotation
    `java.lang.String` | `getSelectorCoordinate​(boolean leaf)` | Get the coordinate for this selector.
    `java.lang.String` | `remap​(java.lang.String reference)` | Remap a reference in the context of this selector, usually via the local refmap of the mixin configuration but can be overridden as needed, for example to provide selector-local remap behaviour.

- - ### Method Detail

    - #### getParent

          ISelectorContext getParent()

      Get the parent (outer/containing) context. Can be null if this is a root element such as an injector method, in which case the parent is the mixin instead.

    - #### getMixin

          IMixinContext getMixin()

      Get the mixin containing this selector.

    - #### getMethod

          java.lang.Object getMethod()

      Get the root method upon which this selector is operating, usually the injector method

    - #### getAnnotation

          IAnnotationHandle getAnnotation()

      Get the root annotation for the selector, for example the injector or accessor annotation

    - #### getSelectorAnnotation

          IAnnotationHandle getSelectorAnnotation()

      Get the annotation for this selector, for example the @At annotation

    - #### getSelectorCoordinate

          java.lang.String getSelectorCoordinate​(boolean leaf)

      Get the coordinate for this selector. This is the local coordinate of the selector without any parent parts. Parent parts are prepended by consumers during the resolve process.
      Parameters:
        `leaf` - True if getting the coordinate when this element is a leaf, false if getting the coordinate when it is a parent

    - #### remap

          java.lang.String remap​(java.lang.String reference)

      Remap a reference in the context of this selector, usually via the local refmap of the mixin configuration but can be overridden as needed, for example to provide selector-local remap behaviour.
      Parameters:
        `reference` - Reference to remap
      Returns:
        Remapped reference or original reference if not remapped, must not return null!

    - #### getElementDescription

          java.lang.String getElementDescription()

      Get a human-readable description of the annotation on the method for use in error messages