Package net.bytebuddy.asm
Interface MemberSubstitution.Substitution<T extends MemberSubstitution.Target>
-
- Type Parameters:
T- The type of the matched target.
- All Known Implementing Classes:
MemberSubstitution.Substitution.Chain,MemberSubstitution.Substitution.ForFieldAccess,MemberSubstitution.Substitution.ForMethodInvocation,MemberSubstitution.Substitution.ForValue,MemberSubstitution.Substitution.Stubbing
- Enclosing class:
- MemberSubstitution
public static interface MemberSubstitution.Substitution<T extends MemberSubstitution.Target>A substitution replaces or enhances an interaction with a field or method within an instrumented method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMemberSubstitution.Substitution.Chain<S extends MemberSubstitution.Target>A substitution chain allows for chaining multiple substitution steps for a byte code element being replaced.static interfaceMemberSubstitution.Substitution.Factory<S extends MemberSubstitution.Target>A factory for creating a substitution for an instrumented method.static classMemberSubstitution.Substitution.ForFieldAccessA substitution with a field access.static classMemberSubstitution.Substitution.ForMethodInvocationA substitution with a method invocation.static classMemberSubstitution.Substitution.ForValueA substitution that loads a fixed value.static classMemberSubstitution.Substitution.StubbingA substitution that drops any field or method access and returns the expected return type's default value, i.enullor zero for primitive types.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StackManipulationresolve(T target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset)Resolves this substitution into a stack manipulation.
-
-
-
Method Detail
-
resolve
StackManipulation resolve(T target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset)
Resolves this substitution into a stack manipulation.- Parameters:
target- The targeted member that is substituted.parameters- All parameters that serve as input to this access.result- The result that is expected from the interaction orvoidif no result is expected.methodHandle- A method handle describing the substituted expression.stackManipulation- The original byte code expression that is being executed.freeOffset- The first free offset of the local variable array that can be used for storing values.- Returns:
- A stack manipulation that represents the access.
-
-