Package net.bytebuddy.asm
Class Advice.Dispatcher.RelocationHandler.ForType
java.lang.Object
net.bytebuddy.asm.Advice.Dispatcher.RelocationHandler.ForType
- All Implemented Interfaces:
Advice.Dispatcher.RelocationHandler
- Enclosing interface:
- Advice.Dispatcher.RelocationHandler
@Enhance
public static class Advice.Dispatcher.RelocationHandler.ForType
extends Object
implements Advice.Dispatcher.RelocationHandler
A relocation handler that is triggered if the checked value is an instance of a given type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A bound relocation handler forAdvice.Dispatcher.RelocationHandler.ForType
.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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription
The type that triggers a relocation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForType
(TypeDescription typeDescription) Creates a new relocation handler that triggers a relocation if a value is an instance of a given type. -
Method Summary
Modifier and TypeMethodDescriptionbind
(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation) Binds this relocation handler to a relocation dispatcher.protected static Advice.Dispatcher.RelocationHandler
of
(TypeDescription typeDescription, TypeDefinition checkedType) Resolves a relocation handler that is triggered if the checked instance is of a given type.
-
Field Details
-
typeDescription
The type that triggers a relocation.
-
-
Constructor Details
-
ForType
Creates a new relocation handler that triggers a relocation if a value is an instance of a given type.- Parameters:
typeDescription
- The type that triggers a relocation.
-
-
Method Details
-
of
protected static Advice.Dispatcher.RelocationHandler of(TypeDescription typeDescription, TypeDefinition checkedType) Resolves a relocation handler that is triggered if the checked instance is of a given type.- Parameters:
typeDescription
- The type that triggers a relocation.checkedType
- The type that is carrying the checked value.- Returns:
- An appropriate relocation handler.
-
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.
-