Class Implementation.Target.AbstractBase
java.lang.Object
net.bytebuddy.implementation.Implementation.Target.AbstractBase
- All Implemented Interfaces:
Implementation.Target
- Direct Known Subclasses:
RebaseImplementationTarget, SubclassImplementationTarget
- Enclosing interface:
Implementation.Target
@Enhance
public abstract static class Implementation.Target.AbstractBase
extends Object
implements Implementation.Target
An abstract base implementation for an
Implementation.Target.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumDetermines if default method invocations are possible.Nested classes/interfaces inherited from interface Implementation.Target
Implementation.Target.AbstractBase, Implementation.Target.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Implementation.Target.AbstractBase.DefaultMethodInvocationThe default method invocation mode to apply.protected final TypeDescriptionThe instrumented type.protected final MethodGraph.LinkedThe instrumented type's method graph. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBase(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation) Creates a new implementation target. -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the instrumented type.Creates a special method invocation for invoking a default method with the given token.invokeDefault(MethodDescription.SignatureToken token, TypeDescription targetType) Creates a special method invocation for invoking a default method.Invokes a dominant method, i.e.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Implementation.Target
getOriginType, invokeSuper
-
Field Details
-
instrumentedType
The instrumented type. -
methodGraph
The instrumented type's method graph. -
defaultMethodInvocation
The default method invocation mode to apply.
-
-
Constructor Details
-
AbstractBase
protected AbstractBase(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation) Creates a new implementation target.- Parameters:
instrumentedType- The instrumented type.methodGraph- The instrumented type's method graph.defaultMethodInvocation- The default method invocation mode to apply.
-
-
Method Details
-
getInstrumentedType
Returns a description of the instrumented type.- Specified by:
getInstrumentedTypein interfaceImplementation.Target- Returns:
- A description of the instrumented type.
-
invokeDefault
Creates a special method invocation for invoking a default method with the given token. The default method call must not be ambiguous or an illegal special method invocation is returned.- Specified by:
invokeDefaultin interfaceImplementation.Target- Parameters:
token- A token of the method that is to be invoked as a default method.- Returns:
- The corresponding default method invocation which might be illegal if the requested invocation is not legal or ambiguous.
-
invokeDefault
public Implementation.SpecialMethodInvocation invokeDefault(MethodDescription.SignatureToken token, TypeDescription targetType) Creates a special method invocation for invoking a default method.- Specified by:
invokeDefaultin interfaceImplementation.Target- Parameters:
token- A token that uniquely describes the method to invoke.targetType- The interface on which the default method is to be invoked.- Returns:
- The corresponding special method invocation which might be illegal if the requested invocation is not legal.
-
invokeDominant
public Implementation.SpecialMethodInvocation invokeDominant(MethodDescription.SignatureToken token) Invokes a dominant method, i.e. if the method token can be invoked as a super method invocation, this invocation is considered dominant. Alternatively, a method invocation is attempted on an interface type as a default method invocation only if this invocation is not ambiguous for several interfaces.- Specified by:
invokeDominantin interfaceImplementation.Target- Parameters:
token- The method token representing the method to be invoked.- Returns:
- A special method invocation for a method representing the method token.
-