public abstract class InvokeInjector extends Injector
Injector.TargetNode| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
annotationType |
classNode, info, isStatic, logger, methodArgs, methodNode, returnType| Constructor and Description |
|---|
InvokeInjector(InjectionInfo info,
java.lang.String annotationType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkTarget(Target target)
Sanity checks on target
|
protected void |
checkTargetForNode(Target target,
InjectionNodes.InjectionNode node)
The normal staticness check is not location-aware, in that it merely
enforces static modifiers of handlers to match their targets.
|
protected void |
checkTargetModifiers(Target target,
boolean exactMatch)
Check that the static modifier of the target method matches the
handler
|
protected void |
inject(Target target,
InjectionNodes.InjectionNode node) |
protected abstract void |
injectAtInvoke(Target target,
InjectionNodes.InjectionNode node)
Perform a single injection
|
protected org.spongepowered.asm.lib.tree.AbstractInsnNode |
invokeHandlerWithArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap) |
protected org.spongepowered.asm.lib.tree.AbstractInsnNode |
invokeHandlerWithArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int startArg,
int endArg) |
protected void |
pushArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int start,
int end)
Load args onto the stack from their positions allocated in argMap
|
protected void |
sanityCheck(Target target,
java.util.List<InjectionPoint> injectionPoints) |
protected int[] |
storeArgs(Target target,
org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int start)
Store args on the stack starting at the end and working back to position
specified by start, return the generated argMap
|
protected void |
storeArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int start,
int end)
Store args on the stack to their positions allocated based on argMap
|
addTargetNode, canCoerce, canCoerce, canCoerce, find, findTargetNodes, inject, invokeHandler, invokeHandler, postInject, throwException, toStringpublic InvokeInjector(InjectionInfo info, java.lang.String annotationType)
info - Information about this injectionannotationType - Annotation type, used for error messagesprotected void sanityCheck(Target target, java.util.List<InjectionPoint> injectionPoints)
sanityCheck in class Injectorprotected void checkTarget(Target target)
target - targetprotected final void checkTargetModifiers(Target target, boolean exactMatch)
target - Target to checkexactMatch - True if static must match, false to only check if an
instance handler is targetting a static methodprotected void checkTargetForNode(Target target, InjectionNodes.InjectionNode node)
target - Target methodnode - Injection locationprotected void inject(Target target, InjectionNodes.InjectionNode node)
protected abstract void injectAtInvoke(Target target, InjectionNodes.InjectionNode node)
target - Target to inject intonode - Discovered instruction nodeprotected org.spongepowered.asm.lib.tree.AbstractInsnNode invokeHandlerWithArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap)
args - handler argumentsinsns - InsnList to inject insns intoargMap - Mapping of args to local variablesprotected org.spongepowered.asm.lib.tree.AbstractInsnNode invokeHandlerWithArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int startArg,
int endArg)
args - handler argumentsinsns - InsnList to inject insns intoargMap - Mapping of args to local variablesstartArg - Starting arg to consumeendArg - Ending arg to consumeprotected int[] storeArgs(Target target, org.spongepowered.asm.lib.Type[] args, org.spongepowered.asm.lib.tree.InsnList insns, int start)
target - target methodargs - argument typesinsns - instruction list to generate insns intostart - Starting indexprotected void storeArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int start,
int end)
args - argument typesinsns - instruction list to generate insns intoargMap - generated argmap containing local indices for all argsstart - Starting indexend - Ending indexprotected void pushArgs(org.spongepowered.asm.lib.Type[] args,
org.spongepowered.asm.lib.tree.InsnList insns,
int[] argMap,
int start,
int end)
args - argument typesinsns - instruction list to generate insns intoargMap - generated argmap containing local indices for all argsstart - Starting indexend - Ending index