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 alsoLocalVariableDiscriminatorandModifyVariable.
-
-
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 Constructor Description ModifyVariableInjector(InjectionInfo info, LocalVariableDiscriminator discriminator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanfindTargetNodes(InjectorTarget target, InjectionPoint injectionPoint, java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)protected java.lang.StringgetTargetNodeKey(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 voidinject(Target target, InjectionNodes.InjectionNode node)Do the injectionprotected voidpreInject(Target target, InjectionNodes.InjectionNode node)protected voidsanityCheck(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
-
-
-
-
Constructor Detail
-
ModifyVariableInjector
public ModifyVariableInjector(InjectionInfo info, LocalVariableDiscriminator discriminator)
- Parameters:
info- Injection infodiscriminator- discriminator
-
-
Method Detail
-
findTargetNodes
protected boolean findTargetNodes(InjectorTarget target, InjectionPoint injectionPoint, java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)
- Overrides:
findTargetNodesin classInjector
-
sanityCheck
protected void sanityCheck(Target target, java.util.List<InjectionPoint> injectionPoints)
- Overrides:
sanityCheckin classInjector
-
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 methodnode- Target node- Returns:
- Key for storing/retrieving the injector context decoration
-
preInject
protected void preInject(Target target, InjectionNodes.InjectionNode node)
-
inject
protected void inject(Target target, InjectionNodes.InjectionNode node)
Do the injection
-
-