Class JavaConstantValue
- java.lang.Object
-
- net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
-
- net.bytebuddy.implementation.bytecode.constant.JavaConstantValue
-
- All Implemented Interfaces:
StackManipulation
@Enhance public class JavaConstantValue extends StackManipulation.AbstractBase
A constant representing aJavaConstant
. By using this stack manipulation, a value is always represented as a constant pool value and no attempt is made to load the value via a specialized byte code instruction, in contrast to usingConstantValue.toStackManipulation()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaConstantValue.Visitor
A visitor to resolve aJavaConstant
to an ASM constant pool representation.-
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
Fields Modifier and Type Field Description private JavaConstant
constant
The instance to load onto the operand stack.
-
Constructor Summary
Constructors Constructor Description JavaConstantValue(JavaConstant constant)
Creates a constant pool value representing aJavaConstant
.
-
Method Summary
All 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.-
Methods inherited from class net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
isValid
-
-
-
-
Field Detail
-
constant
private final JavaConstant constant
The instance to load onto the operand stack.
-
-
Constructor Detail
-
JavaConstantValue
public JavaConstantValue(JavaConstant constant)
Creates a constant pool value representing aJavaConstant
.- Parameters:
constant
- The instance to load onto the operand stack.
-
-
Method Detail
-
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.
-
-