Class ModifyVariableInjector
java.lang.Object
org.spongepowered.asm.mixin.injection.code.Injector
org.spongepowered.asm.mixin.injection.modify.ModifyVariableInjector
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
ConstructorsConstructorDescriptionModifyVariableInjector(InjectionInfo info, LocalVariableDiscriminator discriminator) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanfindTargetNodes(InjectorTarget target, InjectionPoint injectionPoint, Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes) protected 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, 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 Details
-
ModifyVariableInjector
- Parameters:
info- Injection infodiscriminator- discriminator
-
-
Method Details
-
findTargetNodes
protected boolean findTargetNodes(InjectorTarget target, InjectionPoint injectionPoint, Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes) - Overrides:
findTargetNodesin classInjector
-
sanityCheck
- Overrides:
sanityCheckin classInjector
-
getTargetNodeKey
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
-
inject
Do the injection
-