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 java.lang.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 Classes Modifier and Type Class Description protected class
Advice.Dispatcher.RelocationHandler.ForType.Bound
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
Fields Modifier and Type Field Description private TypeDescription
typeDescription
The type that triggers a relocation.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForType(TypeDescription typeDescription)
Creates a new relocation handler that triggers a relocation if a value is an instance of a given type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Advice.Dispatcher.RelocationHandler.Bound
bind(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 Detail
-
typeDescription
private final TypeDescription typeDescription
The type that triggers a relocation.
-
-
Constructor Detail
-
ForType
protected ForType(TypeDescription typeDescription)
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 Detail
-
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.
-
-