Package org.spongepowered.asm.mixin.injection.modify

## Class ModifyVariableInjector

- java.lang.Object
- - org.spongepowered.asm.mixin.injection.code.Injector
  - - org.spongepowered.asm.mixin.injection.modify.ModifyVariableInjector

    public class ModifyVariableInjector
    extends Injector

A bytecode injector which allows a single local variable in the target method to be captured and altered. See also `LocalVariableDiscriminator` and `ModifyVariable`.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.spongepowered.asm.mixin.injection.code.Injector

`Injector.InjectorData, Injector.TargetNode`

### Field Summary

### Fields inherited from class org.spongepowered.asm.mixin.injection.code.Injector

`annotationType, classNode, info, isInterface, isStatic, logger, methodArgs, methodNode, returnType`

### Constructor Summary

Constructors
`ModifyVariableInjector​(InjectionInfo info, LocalVariableDiscriminator discriminator)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `findTargetNodes​(InjectorTarget target, InjectionPoint injectionPoint, java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)`
`protected java.lang.String` `getTargetNodeKey​(Target target, InjectionNodes.InjectionNode node)` Generate a key which uniquely identifies the combination of return type, frame type and target injection node so that injectors targetting the same instruction still get unique contexts.
`protected void` `inject​(Target target, InjectionNodes.InjectionNode node)` Do the injection
`protected void` `preInject​(Target target, InjectionNodes.InjectionNode node)`
`protected void` `sanityCheck​(Target target, java.util.List<InjectionPoint> injectionPoints)`

### Methods inherited from class org.spongepowered.asm.mixin.injection.code.Injector

`addTargetNode, addTargetNode, canCoerce, canCoerce, canCoerce, checkCoerce, checkTargetForNode, checkTargetModifiers, find, inject, invokeHandler, invokeHandler, invokeHandlerWithArgs, invokeHandlerWithArgs, postInject, preInject, pushArgs, pushArgs, storeArgs, storeArgs, storeArgs, storeArgs, throwException, toString, validateParams`

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

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

### Constructor Detail

#### ModifyVariableInjector

    public ModifyVariableInjector​(InjectionInfo info,
                                  LocalVariableDiscriminator discriminator)

Parameters:
  `info` - Injection info
  `discriminator` - discriminator

### Method Detail

#### findTargetNodes

    protected boolean findTargetNodes​(InjectorTarget target,
                                      InjectionPoint injectionPoint,
                                      java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)

Overrides:
  `findTargetNodes` in class `Injector`

#### sanityCheck

    protected void sanityCheck​(Target target,
                               java.util.List<InjectionPoint> injectionPoints)

Overrides:
  `sanityCheck` in class `Injector`

#### getTargetNodeKey

    protected java.lang.String getTargetNodeKey​(Target target,
                                                InjectionNodes.InjectionNode node)

Generate a key which uniquely identifies the combination of return type, frame type and target injection node so that injectors targetting the same instruction still get unique contexts.

Parameters:
  `target` - Target method
  `node` - Target node
Returns:
  Key for storing/retrieving the injector context decoration

#### preInject

    protected void preInject​(Target target,
                             InjectionNodes.InjectionNode node)

Overrides:
  `preInject` in class `Injector`

#### inject

    protected void inject​(Target target,
                          InjectionNodes.InjectionNode node)

Do the injection

Specified by:
  `inject` in class `Injector`