Class MethodRebaseResolver.Default
java.lang.Object
net.bytebuddy.dynamic.scaffold.inline.MethodRebaseResolver.Default
- All Implemented Interfaces:
MethodRebaseResolver
- Enclosing interface:
- MethodRebaseResolver
@Enhance
public static class MethodRebaseResolver.Default
extends Object
implements MethodRebaseResolver
A default implementation of a method rebase resolver.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.inline.MethodRebaseResolver
MethodRebaseResolver.Default, MethodRebaseResolver.Disabled, MethodRebaseResolver.Resolution
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DynamicType>
A list of dynamic types that need to be appended to the created type in order to allow for the rebasement.private final Map<MethodDescription.InDefinedShape,
MethodRebaseResolver.Resolution> A mapping of rebased methods to their existing resolutions. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default
(Map<MethodDescription.InDefinedShape, MethodRebaseResolver.Resolution> resolutions, List<DynamicType> dynamicTypes) Creates a new default method rebased resolver. -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of all rebasable methods' signature tokens to their resolution.Returns a (potentially empty) list of auxiliary types that are required by this method rebase resolver.static MethodRebaseResolver
make
(TypeDescription instrumentedType, Set<? extends MethodDescription.SignatureToken> rebaseables, ClassFileVersion classFileVersion, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, MethodNameTransformer methodNameTransformer) Creates a new method rebase resolver.resolve
(MethodDescription.InDefinedShape methodDescription) Checks if a method is eligible for rebasing and resolves this possibly rebased method.
-
Field Details
-
resolutions
A mapping of rebased methods to their existing resolutions. -
dynamicTypes
A list of dynamic types that need to be appended to the created type in order to allow for the rebasement.
-
-
Constructor Details
-
Default
protected Default(Map<MethodDescription.InDefinedShape, MethodRebaseResolver.Resolution> resolutions, List<DynamicType> dynamicTypes) Creates a new default method rebased resolver.- Parameters:
resolutions
- A mapping of rebased methods to their existing resolutions.dynamicTypes
- A list of dynamic types that need to be appended to the created type in order to allow for the rebasement.
-
-
Method Details
-
make
public static MethodRebaseResolver make(TypeDescription instrumentedType, Set<? extends MethodDescription.SignatureToken> rebaseables, ClassFileVersion classFileVersion, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, MethodNameTransformer methodNameTransformer) Creates a new method rebase resolver.- Parameters:
instrumentedType
- The instrumented type.rebaseables
- Tokens describing all methods that can possibly be rebased.classFileVersion
- The class file version for the instrumentation.auxiliaryTypeNamingStrategy
- The naming strategy for naming a potential auxiliary type.methodNameTransformer
- A transformer for method names.- Returns:
- A method rebase resolver that is capable of rebasing any of the provided methods.
-
resolve
Checks if a method is eligible for rebasing and resolves this possibly rebased method.- Specified by:
resolve
in interfaceMethodRebaseResolver
- Parameters:
methodDescription
- A description of the method to resolve.- Returns:
- A resolution for the given method.
-
getAuxiliaryTypes
Returns a (potentially empty) list of auxiliary types that are required by this method rebase resolver.- Specified by:
getAuxiliaryTypes
in interfaceMethodRebaseResolver
- Returns:
- A list of auxiliary types that are required by this method rebase resolver.
-
asTokenMap
Returns a map of all rebasable methods' signature tokens to their resolution.- Specified by:
asTokenMap
in interfaceMethodRebaseResolver
- Returns:
- A map of all rebasable methods' signature tokens to their resolution.
-