public static class Implementation.SpecialMethodInvocation.Simple extends Object implements Implementation.SpecialMethodInvocation
Implementation.SpecialMethodInvocation
.Implementation.SpecialMethodInvocation.Illegal, Implementation.SpecialMethodInvocation.Simple
StackManipulation.Compound, StackManipulation.LegalTrivial, StackManipulation.Size
Modifier | Constructor and Description |
---|---|
protected |
Simple(MethodDescription methodDescription,
TypeDescription typeDescription,
StackManipulation stackManipulation)
Creates a new legal special method invocation.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation.Size |
apply(MethodVisitor methodVisitor,
Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.
|
boolean |
equals(Object other) |
MethodDescription |
getMethodDescription()
Returns the method that represents this special method invocation.
|
TypeDescription |
getTypeDescription()
Returns the target type the represented method is invoked on.
|
int |
hashCode() |
boolean |
isValid()
Determines if this stack manipulation is valid.
|
static Implementation.SpecialMethodInvocation |
of(MethodDescription methodDescription,
TypeDescription typeDescription)
Creates a special method invocation for a given invocation target.
|
String |
toString() |
protected Simple(MethodDescription methodDescription, TypeDescription typeDescription, StackManipulation stackManipulation)
methodDescription
- The method that represents the special method invocation.typeDescription
- The type on which the method should be invoked on by an INVOKESPECIAL
invocation.stackManipulation
- The stack manipulation that represents this special method invocation.public static Implementation.SpecialMethodInvocation of(MethodDescription methodDescription, TypeDescription typeDescription)
methodDescription
- The method that represents the special method invocation.typeDescription
- The type on which the method should be invoked on by an INVOKESPECIAL
invocation.public MethodDescription getMethodDescription()
Implementation.SpecialMethodInvocation
Implementation.Target
.getMethodDescription
in interface Implementation.SpecialMethodInvocation
public TypeDescription getTypeDescription()
Implementation.SpecialMethodInvocation
getTypeDescription
in interface Implementation.SpecialMethodInvocation
public boolean isValid()
StackManipulation
isValid
in interface StackManipulation
false
, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)
StackManipulation
apply
in interface StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.Copyright © 2014–2015. All rights reserved.