Package org.stianloader.micromixin.transform.internal.selectors.inject

## Class ReturnInjectionPointSelector

- java.lang.Object
- - org.stianloader.micromixin.transform.api.InjectionPointSelector
  - - org.stianloader.micromixin.transform.internal.selectors.inject.ReturnInjectionPointSelector

- All Implemented Interfaces:
    `InjectionPointSelectorFactory.InjectionPointSelectorProvider`

      public class ReturnInjectionPointSelector
      extends InjectionPointSelector
      implements InjectionPointSelectorFactory.InjectionPointSelectorProvider

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static ReturnInjectionPointSelector` | `INSTANCE` |

    - ### Fields inherited from class org.stianloader.micromixin.transform.api.InjectionPointSelector

      `allNames, fullyQualifiedName`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `InjectionPointSelector` | `create​(java.util.List<java.lang.String> args, InjectionPointConstraint[] constraints)` | Create an `InjectionPointSelector` that selects the instructions with the provided constraints.
    `java.util.Set<java.lang.String>` | `getAllNames()` |
    `org.objectweb.asm.tree.AbstractInsnNode` | `getFirstInsn​(org.objectweb.asm.tree.MethodNode method, SlicedInjectionPointSelector from, SlicedInjectionPointSelector to, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` | Obtains the first `AbstractInsnNode` that corresponds to the first applicable entrypoint within the provided method as defined by this `InjectionPointSelector`.
    `java.lang.String` | `getFullyQualifiedName()` |
    `java.util.Collection<? extends org.objectweb.asm.tree.AbstractInsnNode>` | `getMatchedInstructions​(org.objectweb.asm.tree.MethodNode method, SlicedInjectionPointSelector from, SlicedInjectionPointSelector to, SimpleRemapper remapper, java.lang.StringBuilder sharedBuilder)` | Obtains the `AbstractInsnNodes` that correspond to every applicable entrypoint within the provided method as defined by this `InjectionPointSelector`.
    `boolean` | `supportsRedirect()` | WARNING WARNING WARNING The method was deprecated for removal in the 0.6.X lifecycle and will get removed at an unspecified point in time (this might fall within the 0.7.X lifecycle!).

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

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

- - ### Field Detail

    - #### INSTANCE

          @NotNull
          public static final ReturnInjectionPointSelector INSTANCE

  - ### Method Detail

    - #### getFirstInsn

          @Nullable
          public org.objectweb.asm.tree.AbstractInsnNode getFirstInsn​(@NotNull
                                                                      org.objectweb.asm.tree.MethodNode method,
                                                                      @Nullable
                                                                      SlicedInjectionPointSelector from,
                                                                      @Nullable
                                                                      SlicedInjectionPointSelector to,
                                                                      @NotNull
                                                                      SimpleRemapper remapper,
                                                                      @NotNull
                                                                      java.lang.StringBuilder sharedBuilder)

      Description copied from class: `InjectionPointSelector`
      Obtains the first `AbstractInsnNode` that corresponds to the first applicable entrypoint within the provided method as defined by this `InjectionPointSelector`. The `AbstractInsnNode` may not be virtual, that is it may not have an `opcode` value of -1.

      Implementations of this method are trusted to not go out of bounds when it comes to the slices. Failure to do so could have nasty consequences for user behaviour as micromixin-transformer or any other caller is not guaranteed to verify the location of the matched instruction (but inversely it is not guaranteed that such as check won't be introduced in the future).

      Specified by:
        `getFirstInsn` in class `InjectionPointSelector`
      Parameters:
        `method` - The method to find the entrypoints in.
        `from` - The `InjectionPointSelector` that represents the start of the slice where the injection point should be selected from. May be null to represent HEAD (start of method).
        `to` - The `InjectionPointSelector` that represents the end of the slice where the injection point should be selected from. May be null to represent TAIL (end of method).
        `remapper` - The remapper instance to make use of. This is used to remap any references of the mixin class to the target class when applying injection point constraints.
        `sharedBuilder` - Shared `StringBuilder` instance to reduce `StringBuilder` allocations.
      Returns:
        The first matched instruction, or null if no instructions match.

    - #### getMatchedInstructions

          @NotNull
          public java.util.Collection<? extends org.objectweb.asm.tree.AbstractInsnNode> getMatchedInstructions​(@NotNull
                                                                                                                org.objectweb.asm.tree.MethodNode method,
                                                                                                                @Nullable
                                                                                                                SlicedInjectionPointSelector from,
                                                                                                                @Nullable
                                                                                                                SlicedInjectionPointSelector to,
                                                                                                                @NotNull
                                                                                                                SimpleRemapper remapper,
                                                                                                                @NotNull
                                                                                                                java.lang.StringBuilder sharedBuilder)

      Description copied from class: `InjectionPointSelector`
      Obtains the `AbstractInsnNodes` that correspond to every applicable entrypoint within the provided method as defined by this `InjectionPointSelector`.

      Implementations of this method are trusted to not go out of bounds when it comes to the slices. Failure to do so could have nasty consequences for user behaviour as micromixin-transformer or any other caller is not guaranteed to verify the location of the matched instructions (but inversely it is not guaranteed that such as check won't be introduced in the future).

      Specified by:
        `getMatchedInstructions` in class `InjectionPointSelector`
      Parameters:
        `method` - The method to find the entrypoints in.
        `from` - The `InjectionPointSelector` that represents the start of the slice where the injection point should be selected from. May be null to represent HEAD (start of method).
        `to` - The `InjectionPointSelector` that represents the end of the slice where the injection point should be selected from. May be null to represent TAIL (end of method).
        `remapper` - The remapper instance to make use of. This is used to remap any references of the mixin class to the target class when applying injection point constraints.
        `sharedBuilder` - Shared `StringBuilder` instance to reduce `StringBuilder` allocations.
      Returns:
        The selected instruction nodes that correspond to this entry point.

    - #### supportsRedirect

          public boolean supportsRedirect()

      Description copied from class: `InjectionPointSelector`
      WARNING WARNING WARNING The method was deprecated for removal in the 0.6.X lifecycle and will get removed at an unspecified point in time (this might fall within the 0.7.X lifecycle!). This method is no longer considered to be part of the public API.

      Checks whether the injection point can be used in conjunction with the Redirect-annotation. Generally should only be true if this injection point selector can select method instruction nodes.

      Overrides:
        `supportsRedirect` in class `InjectionPointSelector`
      Returns:
        True if usable in redirects, false otherwise.

    - #### getFullyQualifiedName

          @NotNull
          public java.lang.String getFullyQualifiedName()

      Specified by:
        `getFullyQualifiedName` in interface `InjectionPointSelectorFactory.InjectionPointSelectorProvider`

    - #### getAllNames

          @NotNull
          public java.util.Set<java.lang.String> getAllNames()

      Specified by:
        `getAllNames` in interface `InjectionPointSelectorFactory.InjectionPointSelectorProvider`

    - #### create

          @NotNull
          @AvailableSince("0.7.0-a20241008")
          @Contract(pure=true)
          public InjectionPointSelector create​(@Nullable
                                               java.util.List<java.lang.String> args,
                                               @NotNull
                                               InjectionPointConstraint[] constraints)

      Description copied from interface: `InjectionPointSelectorFactory.InjectionPointSelectorProvider`
      Create an `InjectionPointSelector` that selects the instructions with the provided constraints. The selector is optionally further constrained by the arguments defined in the `@At` annotation.
      Specified by:
        `create` in interface `InjectionPointSelectorFactory.InjectionPointSelectorProvider`
      Parameters:
        `args` - The arguments defined in the `@At` annotation, null if no arguments were defined. May be empty.
        `constraints` - The constraints defined in the `@At` annotation. Any instruction matched by the selector must match all constraints. These constraints can limit the selected opcodes, constrain on `MethodInsnNode.name` and more.
      Returns:
        The selector using the requested semantics.