Class InstanceCheck
java.lang.Object
net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
net.bytebuddy.implementation.bytecode.assign.InstanceCheck
- All Implemented Interfaces:
StackManipulation
Implements an
instanceof check.-
Nested Class Summary
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 TypeDescriptionThe type to apply the instance check against. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstanceCheck(TypeDescription typeDescription) Creates a new instance check. -
Method Summary
Modifier and TypeMethodDescriptionapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the stack manipulation that is described by this instance.static StackManipulationof(TypeDescription typeDescription) Creates a new instance check.Methods inherited from class net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
isValid
-
Field Details
-
typeDescription
The type to apply the instance check against.
-
-
Constructor Details
-
InstanceCheck
Creates a new instance check.- Parameters:
typeDescription- The type to apply the instance check against.
-
-
Method Details
-
of
Creates a new instance check.- Parameters:
typeDescription- The type to apply the instance check against.- Returns:
- An appropriate stack manipulation.
-
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.
-