Class MethodVariableAccess.MethodLoading.TypeCastingHandler.ForBridgeTarget
java.lang.Object
net.bytebuddy.implementation.bytecode.member.MethodVariableAccess.MethodLoading.TypeCastingHandler.ForBridgeTarget
- All Implemented Interfaces:
MethodVariableAccess.MethodLoading.TypeCastingHandler
- Enclosing interface:
MethodVariableAccess.MethodLoading.TypeCastingHandler
@Enhance
public static class MethodVariableAccess.MethodLoading.TypeCastingHandler.ForBridgeTarget
extends Object
implements MethodVariableAccess.MethodLoading.TypeCastingHandler
A type casting handler that casts all parameters of a method to the parameter types of a compatible method
with covariant parameter types. This allows a convenient implementation of bridge methods.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.member.MethodVariableAccess.MethodLoading.TypeCastingHandler
MethodVariableAccess.MethodLoading.TypeCastingHandler.ForBridgeTarget, MethodVariableAccess.MethodLoading.TypeCastingHandler.NoOp
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription
The target of the method bridge. -
Constructor Summary
ConstructorsConstructorDescriptionForBridgeTarget
(MethodDescription bridgeTarget) Creates a new type casting handler for a bridge target. -
Method Summary
Modifier and TypeMethodDescriptionofIndex
(TypeDescription parameterType, int index) Yields a stack transformation to transform the given argument of the method for which the arguments are loaded onto the operand stack.
-
Field Details
-
bridgeTarget
The target of the method bridge.
-
-
Constructor Details
-
ForBridgeTarget
Creates a new type casting handler for a bridge target.- Parameters:
bridgeTarget
- The target of the method bridge.
-
-
Method Details
-
ofIndex
Yields a stack transformation to transform the given argument of the method for which the arguments are loaded onto the operand stack.- Specified by:
ofIndex
in interfaceMethodVariableAccess.MethodLoading.TypeCastingHandler
- Parameters:
parameterType
- The parameter type that is to be transformed.index
- The index of the transformed parameter.- Returns:
- A transformation to apply after loading the parameter onto the operand stack.
-