Class RebaseImplementationTarget.RebasedMethodInvocation
- java.lang.Object
-
- net.bytebuddy.implementation.Implementation.SpecialMethodInvocation.AbstractBase
-
- net.bytebuddy.dynamic.scaffold.inline.RebaseImplementationTarget.RebasedMethodInvocation
-
- All Implemented Interfaces:
StackManipulation
,Implementation.SpecialMethodInvocation
- Enclosing class:
- RebaseImplementationTarget
protected static class RebaseImplementationTarget.RebasedMethodInvocation extends Implementation.SpecialMethodInvocation.AbstractBase
AImplementation.SpecialMethodInvocation
which invokes a rebased method as given by aMethodRebaseResolver
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation.SpecialMethodInvocation
Implementation.SpecialMethodInvocation.AbstractBase, Implementation.SpecialMethodInvocation.Illegal, Implementation.SpecialMethodInvocation.Simple
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.Compound, StackManipulation.Size, StackManipulation.Trivial
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
instrumentedType
The instrumented type on which the method should be invoked on.private MethodDescription
methodDescription
The method to invoke via a special method invocation.private TypeList
prependedParameters
Any additional arguments that are to be provided to the rebased method.private StackManipulation
stackManipulation
The stack manipulation to execute in order to invoke the rebased method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RebasedMethodInvocation(MethodDescription methodDescription, TypeDescription instrumentedType, StackManipulation stackManipulation, TypeList prependedParameters)
Creates a new rebased method invocation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.MethodDescription
getMethodDescription()
Returns the method that represents this special method invocation.TypeDescription
getTypeDescription()
Returns the target type the represented method is invoked on.protected static Implementation.SpecialMethodInvocation
of(MethodDescription resolvedMethod, TypeDescription instrumentedType, TypeList prependedParameters)
Creates a special method invocation for the given method.Implementation.SpecialMethodInvocation
withCheckedCompatibilityTo(MethodDescription.TypeToken token)
Checks that this special method invocation is compatible with the supplied type representation.-
Methods inherited from class net.bytebuddy.implementation.Implementation.SpecialMethodInvocation.AbstractBase
equals, hashCode, isValid
-
-
-
-
Field Detail
-
methodDescription
private final MethodDescription methodDescription
The method to invoke via a special method invocation.
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type on which the method should be invoked on.
-
stackManipulation
private final StackManipulation stackManipulation
The stack manipulation to execute in order to invoke the rebased method.
-
prependedParameters
private final TypeList prependedParameters
Any additional arguments that are to be provided to the rebased method.
-
-
Constructor Detail
-
RebasedMethodInvocation
protected RebasedMethodInvocation(MethodDescription methodDescription, TypeDescription instrumentedType, StackManipulation stackManipulation, TypeList prependedParameters)
Creates a new rebased method invocation.- Parameters:
methodDescription
- The method to invoke via a special method invocation.instrumentedType
- The instrumented type on which the method should be invoked on.stackManipulation
- The stack manipulation to execute in order to invoke the rebased method.prependedParameters
- Any additional arguments that are to be provided to the rebased method.
-
-
Method Detail
-
of
protected static Implementation.SpecialMethodInvocation of(MethodDescription resolvedMethod, TypeDescription instrumentedType, TypeList prependedParameters)
Creates a special method invocation for the given method.- Parameters:
resolvedMethod
- The rebased method to be invoked.instrumentedType
- The instrumented type on which the method is to be invoked if it is non-static.prependedParameters
- Any additional arguments that are to be provided to the rebased method.- Returns:
- A special method invocation of the rebased method.
-
getMethodDescription
public MethodDescription getMethodDescription()
Returns the method that represents this special method invocation. This method can be different even for equal special method invocations, dependant on the method that was used to request such an invocation by the means of aImplementation.Target
.- Returns:
- The method description that describes this instances invocation target.
-
getTypeDescription
public TypeDescription getTypeDescription()
Returns the target type the represented method is invoked on.- Returns:
- The type the represented method is invoked on.
-
apply
public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.- Parameters:
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.- Returns:
- The changes to the size of the operand stack that are implied by this stack manipulation.
-
withCheckedCompatibilityTo
public Implementation.SpecialMethodInvocation withCheckedCompatibilityTo(MethodDescription.TypeToken token)
Checks that this special method invocation is compatible with the supplied type representation.- Parameters:
token
- The type token to check against.- Returns:
- This special method invocation or an illegal invocation if the method invocation is not applicable.
-
-