Class CallbackInjector
- java.lang.Object
-
- org.spongepowered.asm.mixin.injection.code.Injector
-
- org.spongepowered.asm.mixin.injection.callback.CallbackInjector
-
-
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 CallbackInjector(InjectionInfo info, boolean cancellable, LocalCapture localCapture, java.lang.String identifier)Make a new CallbackInjector with the supplied args
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTargetNode(InjectorTarget injectorTarget, java.util.List<InjectionNodes.InjectionNode> myNodes, org.objectweb.asm.tree.AbstractInsnNode node, java.util.Set<InjectionPoint> nominators)protected voidinject(Target target, InjectionNodes.InjectionNode node)protected voidinjectCancellationCode(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback)if (e.isCancelled()) return e.getReturnValue();protected voidinjectReturnCode(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback)Inject the appropriate return code for the method typeprotected voidinstanceCallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback, java.lang.String id, java.lang.String desc, boolean store)protected booleanisStatic()Explicit to avoid creation of synthetic accessorprotected 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, canCoerce, canCoerce, canCoerce, checkCoerce, checkTargetForNode, checkTargetModifiers, find, findTargetNodes, inject, invokeHandler, invokeHandler, invokeHandlerWithArgs, invokeHandlerWithArgs, postInject, preInject, pushArgs, pushArgs, storeArgs, storeArgs, storeArgs, storeArgs, throwException, toString, validateParams
-
-
-
-
Constructor Detail
-
CallbackInjector
public CallbackInjector(InjectionInfo info, boolean cancellable, LocalCapture localCapture, java.lang.String identifier)
Make a new CallbackInjector with the supplied args- Parameters:
info- information about this injectorcancellable- True if injections performed by this injector should be cancellablelocalCapture- Local variable capture behaviour
-
-
Method Detail
-
sanityCheck
protected void sanityCheck(Target target, java.util.List<InjectionPoint> injectionPoints)
- Overrides:
sanityCheckin classInjector
-
addTargetNode
protected void addTargetNode(InjectorTarget injectorTarget, java.util.List<InjectionNodes.InjectionNode> myNodes, org.objectweb.asm.tree.AbstractInsnNode node, java.util.Set<InjectionPoint> nominators)
- Overrides:
addTargetNodein classInjector
-
preInject
protected void preInject(Target target, InjectionNodes.InjectionNode node)
-
inject
protected void inject(Target target, InjectionNodes.InjectionNode node)
-
instanceCallbackInfo
protected void instanceCallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback, java.lang.String id, java.lang.String desc, boolean store)- Parameters:
callback- callback handleid- callback iddesc- constructor descriptorstore- true if storing in a local, false if this is happening at an invoke
-
injectCancellationCode
protected void injectCancellationCode(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback)
if (e.isCancelled()) return e.getReturnValue();- Parameters:
callback- callback handle
-
injectReturnCode
protected void injectReturnCode(org.spongepowered.asm.mixin.injection.callback.CallbackInjector.Callback callback)
Inject the appropriate return code for the method type- Parameters:
callback- callback handle
-
isStatic
protected boolean isStatic()
Explicit to avoid creation of synthetic accessor- Returns:
- true if the target method is static
-
-