public class BeforeReturn extends InjectionPoint
This injection point searches for RETURN opcodes in the target method and
returns a list of insns immediately prior to matching instructions. Note that
every RETURN opcode will be returned and thus every natural exit
from the method except for exception throws will be implicitly specified. To
specify a particular RETURN use the ordinal parameter. The injection
point accepts the following parameters from
At:
Example:
@At(value = "RETURN")
Note that if value is the only parameter specified, it can be omitted:
@At("RETURN")
InjectionPoint.AtCode, InjectionPoint.RestrictTargetLevel, InjectionPoint.SelectorDEFAULT_ALLOWED_SHIFT_BY, MAX_ALLOWED_SHIFT_BY| Constructor and Description |
|---|
BeforeReturn(InjectionPointData data) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPriority(int targetPriority,
int ownerPriority)
Runs a priority check in the context of this injection point.
|
boolean |
find(java.lang.String desc,
org.objectweb.asm.tree.InsnList insns,
java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)
Find injection points in the supplied insn list
|
InjectionPoint.RestrictTargetLevel |
getTargetRestriction(IInjectionPointContext context)
Returns the target restriction level for this injection point.
|
public BeforeReturn(InjectionPointData data)
public boolean checkPriority(int targetPriority,
int ownerPriority)
InjectionPointcheckPriority in class InjectionPointtargetPriority - Priority of the mixin which originally merged the
target method in questionownerPriority - Priority of the mixin which owns the owning injectorpublic InjectionPoint.RestrictTargetLevel getTargetRestriction(IInjectionPointContext context)
InjectionPointCallbackInjector).getTargetRestriction in class InjectionPointcontext - injection-specific contextpublic boolean find(java.lang.String desc,
org.objectweb.asm.tree.InsnList insns,
java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)
InjectionPointfind in class InjectionPointdesc - Method descriptor, supplied to allow return types and
arguments etc. to be determinedinsns - Insn list to search in, the strategy MUST ONLY add nodes
from this list to the nodes collectionnodes - Collection of nodes to populate. Injectors should NOT make
any assumptions about the state of this collection and should only
call the add() method