Package net.bytebuddy.asm
Enum Class Advice.Dispatcher.RelocationHandler.ForValue
java.lang.Object
java.lang.Enum<Advice.Dispatcher.RelocationHandler.ForValue>
net.bytebuddy.asm.Advice.Dispatcher.RelocationHandler.ForValue
- All Implemented Interfaces:
Serializable
,Comparable<Advice.Dispatcher.RelocationHandler.ForValue>
,Constable
,Advice.Dispatcher.RelocationHandler
- Enclosing interface:
- Advice.Dispatcher.RelocationHandler
public static enum Advice.Dispatcher.RelocationHandler.ForValue
extends Enum<Advice.Dispatcher.RelocationHandler.ForValue>
implements Advice.Dispatcher.RelocationHandler
A relocation handler that triggers a relocation for a default or non-default value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A bound relocation handler forAdvice.Dispatcher.RelocationHandler.ForValue
.protected class
An inverted version of the outer relocation handler.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Dispatcher.RelocationHandler
Advice.Dispatcher.RelocationHandler.Disabled, Advice.Dispatcher.RelocationHandler.ForType, Advice.Dispatcher.RelocationHandler.ForValue, Advice.Dispatcher.RelocationHandler.Relocation
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The opcode to check for a non-default value.private final int
An opcode for loading a value of the represented type from the local variable array.private final int
The opcode to check for a default value.private final int
The minimal required stack size to apply this relocation handler. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ForValue
(int load, int defaultJump, int nonDefaultJump, int requiredSize) Creates a new relocation handler for a type's default or non-default value. -
Method Summary
Modifier and TypeMethodDescriptionbind
(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation) Binds this relocation handler to a relocation dispatcher.protected abstract void
convertValue
(org.objectweb.asm.MethodVisitor methodVisitor) Applies a value conversion prior to a applying a conditional jump.protected static Advice.Dispatcher.RelocationHandler
of
(TypeDefinition typeDefinition, boolean inverted) Resolves a relocation handler for a given type.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INTEGER
A relocation handler for anint
type or any compatible type. -
LONG
A relocation handler for along
type. -
FLOAT
A relocation handler for afloat
type. -
DOUBLE
A relocation handler for adouble
type. -
REFERENCE
A relocation handler for a reference type.
-
-
Field Details
-
load
private final int loadAn opcode for loading a value of the represented type from the local variable array. -
defaultJump
private final int defaultJumpThe opcode to check for a non-default value. -
nonDefaultJump
private final int nonDefaultJumpThe opcode to check for a default value. -
requiredSize
private final int requiredSizeThe minimal required stack size to apply this relocation handler.
-
-
Constructor Details
-
ForValue
private ForValue(int load, int defaultJump, int nonDefaultJump, int requiredSize) Creates a new relocation handler for a type's default or non-default value.- Parameters:
load
- An opcode for loading a value of the represented type from the local variable array.defaultJump
- The opcode to check for a non-default value.nonDefaultJump
- The opcode to check for a default value.requiredSize
- The minimal required stack size to apply this relocation handler.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
of
protected static Advice.Dispatcher.RelocationHandler of(TypeDefinition typeDefinition, boolean inverted) Resolves a relocation handler for a given type.- Parameters:
typeDefinition
- The type to be resolved for a relocation attempt.inverted
-true
if the relocation should be applied for any non-default value of a type.- Returns:
- An appropriate relocation handler.
-
convertValue
protected abstract void convertValue(org.objectweb.asm.MethodVisitor methodVisitor) Applies a value conversion prior to a applying a conditional jump.- Parameters:
methodVisitor
- The method visitor to use.
-
bind
public Advice.Dispatcher.RelocationHandler.Bound bind(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation) Binds this relocation handler to a relocation dispatcher.- Specified by:
bind
in interfaceAdvice.Dispatcher.RelocationHandler
- Parameters:
instrumentedMethod
- The instrumented method.relocation
- The relocation to apply.- Returns:
- A bound relocation handler.
-