Package net.bytebuddy.implementation
Class Implementation.SpecialMethodInvocation.Simple
java.lang.Object
net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
net.bytebuddy.implementation.Implementation.SpecialMethodInvocation.AbstractBase
net.bytebuddy.implementation.Implementation.SpecialMethodInvocation.Simple
- All Implemented Interfaces:
StackManipulation
,Implementation.SpecialMethodInvocation
- Enclosing interface:
Implementation.SpecialMethodInvocation
public static class Implementation.SpecialMethodInvocation.Simple
extends Implementation.SpecialMethodInvocation.AbstractBase
A canonical implementation of a
Implementation.SpecialMethodInvocation
.-
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.AbstractBase, StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription
The method description that is represented by this legal special method invocation.private final StackManipulation
A stack manipulation representing the method's invocation on the type description.private final TypeDescription
The type description that is represented by this legal special method invocation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Simple
(MethodDescription methodDescription, TypeDescription typeDescription, StackManipulation stackManipulation) Creates a new legal special method invocation. -
Method Summary
Modifier and TypeMethodDescriptionapply
(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the stack manipulation that is described by this instance.Returns the method that represents this special method invocation.Returns the target type the represented method is invoked on.of
(MethodDescription methodDescription, TypeDescription typeDescription) Creates a special method invocation for a given invocation target.Returns a method handle representing this special method invocation.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
Methods inherited from class net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
isValid
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
isValid
-
Field Details
-
methodDescription
The method description that is represented by this legal special method invocation. -
typeDescription
The type description that is represented by this legal special method invocation. -
stackManipulation
A stack manipulation representing the method's invocation on the type description.
-
-
Constructor Details
-
Simple
protected Simple(MethodDescription methodDescription, TypeDescription typeDescription, StackManipulation stackManipulation) Creates a new legal special method invocation.- Parameters:
methodDescription
- The method that represents the special method invocation.typeDescription
- The type on which the method should be invoked on by anINVOKESPECIAL
invocation.stackManipulation
- The stack manipulation that represents this special method invocation.
-
-
Method Details
-
of
public static Implementation.SpecialMethodInvocation of(MethodDescription methodDescription, TypeDescription typeDescription) Creates a special method invocation for a given invocation target.- Parameters:
methodDescription
- The method that represents the special method invocation.typeDescription
- The type on which the method should be invoked on by anINVOKESPECIAL
invocation.- Returns:
- A special method invocation representing a legal invocation if the method can be invoked specially on the target type or an illegal invocation if this is not possible.
-
getMethodDescription
Returns the method that represents this special method invocation. This method can be different even for equal special method invocations, dependent 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
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.
-
toMethodHandle
Returns a method handle representing this special method invocation.- Returns:
- A method handle for this special method invocation.
-