Enum Class LocalCapture

java.lang.Object
java.lang.Enum<LocalCapture>
org.spongepowered.asm.mixin.injection.callback.LocalCapture
All Implemented Interfaces:
Serializable, Comparable<LocalCapture>, Constable

public enum LocalCapture extends Enum<LocalCapture>
Specifies the behaviour for capturing local variables at an injection point.

Since local capture relies on calculating the local variable table for the target method it is disabled by default for performance reasons. When capturing is enabled, local variables are passed to the handler method after the CallbackInfo argument. Since it is entirely possible for another transformer to make an incompatible change to the the local variable table at run time, the purpose of this enum is to specify the behaviour for local capture and the type of recovery to be performed when an incompatible change is detected.

  • Enum Constant Details

    • NO_CAPTURE

      public static final LocalCapture NO_CAPTURE
      Do not capture locals, this is the default behaviour
    • PRINT

      public static final LocalCapture PRINT
      Do not capture locals. Print the expected method signature to stderr instead.
    • CAPTURE_FAILSOFT

      public static final LocalCapture CAPTURE_FAILSOFT
      Capture locals. If the calculated locals are different from the expected values, log a warning and skip this injection.
    • CAPTURE_FAILHARD

      public static final LocalCapture CAPTURE_FAILHARD
      Capture locals. If the calculated locals are different from the expected values, throw an Error.
    • CAPTURE_FAILEXCEPTION

      public static final LocalCapture CAPTURE_FAILEXCEPTION
      Capture locals. If the calculated locals are different from the expected values, generate a method stub containing an exception. This will allow normal execution to continue unless the callback is encountered.
  • Method Details

    • values

      public static LocalCapture[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LocalCapture valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null