Interface InjectStrategy
-
- All Known Implementing Classes:
FirstBlock
public interface InjectStrategy
This interface defines methods for determining code attribute offsets suitable for injecting a method invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
InjectStrategy.InjectLocation
A data structure indicating a suitable location for injecting a method invocation instruction.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InjectStrategy.InjectLocation[]
getAllSuitableInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Determine all locations (i.e., offsets) suitable for injecting a method invocation.InjectStrategy.InjectLocation
getSingleInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Determine one location (i.e., offset) suitable for injecting a method invocation.
-
-
-
Method Detail
-
getSingleInjectionLocation
InjectStrategy.InjectLocation getSingleInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Determine one location (i.e., offset) suitable for injecting a method invocation.- Parameters:
targetClass
- The class holding the method in which a method invocation shall be injected into.targetMethod
- the target method to have a method invocation injected into.- Returns:
- An InjectLocation instance indicating an offset suitable for injection and whether the injection shall happen before or after the offset.
-
getAllSuitableInjectionLocation
InjectStrategy.InjectLocation[] getAllSuitableInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Determine all locations (i.e., offsets) suitable for injecting a method invocation.- Parameters:
targetClass
- The class holding the method in which a method invocation shall be injected into.targetMethod
- the target method to have a method invocation injected into.- Returns:
- An array of InjectLocation instances indicating offsets suitable for injection and whether the injection shall take place before or after each offset.
-
-