Package net.bytebuddy.implementation
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 java.lang.Object implements Implementation.Target
An abstract base implementation for anImplementation.Target
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Implementation.Target.AbstractBase.DefaultMethodInvocation
Determines if default method invocations are possible.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation.Target
Implementation.Target.AbstractBase, Implementation.Target.Factory
-
-
Field Summary
Fields Modifier and Type Field Description protected Implementation.Target.AbstractBase.DefaultMethodInvocation
defaultMethodInvocation
The default method invocation mode to apply.protected TypeDescription
instrumentedType
The instrumented type.protected MethodGraph.Linked
methodGraph
The instrumented type's method graph.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBase(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation)
Creates a new implementation target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDescription
getInstrumentedType()
Returns a description of the instrumented type.Implementation.SpecialMethodInvocation
invokeDefault(MethodDescription.SignatureToken token)
Creates a special method invocation for invoking a default method with the given token.Implementation.SpecialMethodInvocation
invokeDefault(MethodDescription.SignatureToken token, TypeDescription targetType)
Creates a special method invocation for invoking a default method.Implementation.SpecialMethodInvocation
invokeDominant(MethodDescription.SignatureToken token)
Invokes a dominant method, i.e.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.implementation.Implementation.Target
getOriginType, invokeSuper
-
-
-
-
Field Detail
-
instrumentedType
protected final TypeDescription instrumentedType
The instrumented type.
-
methodGraph
protected final MethodGraph.Linked methodGraph
The instrumented type's method graph.
-
defaultMethodInvocation
protected final Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation
The default method invocation mode to apply.
-
-
Constructor Detail
-
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 Detail
-
getInstrumentedType
public TypeDescription getInstrumentedType()
Returns a description of the instrumented type.- Specified by:
getInstrumentedType
in interfaceImplementation.Target
- Returns:
- A description of the instrumented type.
-
invokeDefault
public Implementation.SpecialMethodInvocation invokeDefault(MethodDescription.SignatureToken token)
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:
invokeDefault
in 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:
invokeDefault
in 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:
invokeDominant
in 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.
-
-