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 classAdvice.Dispatcher.RelocationHandler.ForType.BoundA 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 intindexThe index of the array returned by the advice method that contains the value to check for its type.private TypeDescriptiontypeDescriptionThe type that triggers a relocation.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForType(TypeDescription typeDescription, int index)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.Boundbind(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation)Binds this relocation handler to a relocation dispatcher.protected static Advice.Dispatcher.RelocationHandlerof(TypeDescription typeDescription, int index, TypeDefinition returnedType)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.
-
index
private final int index
The index of the array returned by the advice method that contains the value to check for its type.
-
-
Constructor Detail
-
ForType
protected ForType(TypeDescription typeDescription, int index)
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.index- The index of the array returned by the advice method that contains the value to check for its type.
-
-
Method Detail
-
of
protected static Advice.Dispatcher.RelocationHandler of(TypeDescription typeDescription, int index, TypeDefinition returnedType)
Resolves a relocation handler that is triggered if the checked instance is of a given type.- Parameters:
typeDescription- The type that triggers a relocation.index- The array index of the value that is returned.returnedType- The type that is returned by the advice method.- 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:
bindin interfaceAdvice.Dispatcher.RelocationHandler- Parameters:
instrumentedMethod- The instrumented method.relocation- The relocation to apply.- Returns:
- A bound relocation handler.
-
-