Class SubclassImplementationTarget
- java.lang.Object
-
- net.bytebuddy.implementation.Implementation.Target.AbstractBase
-
- net.bytebuddy.dynamic.scaffold.subclass.SubclassImplementationTarget
-
- All Implemented Interfaces:
Implementation.Target
@Enhance public class SubclassImplementationTarget extends Implementation.Target.AbstractBase
An implementation target for creating a subclass of a given type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubclassImplementationTarget.Factory
A factory for creating aSubclassImplementationTarget
.static class
SubclassImplementationTarget.OriginTypeResolver
Responsible for identifying the origin type that an implementation target represents whenImplementation.Target.getOriginType()
is invoked.-
Nested classes/interfaces inherited from class net.bytebuddy.implementation.Implementation.Target.AbstractBase
Implementation.Target.AbstractBase.DefaultMethodInvocation
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation.Target
Implementation.Target.AbstractBase
-
-
Field Summary
Fields Modifier and Type Field Description protected SubclassImplementationTarget.OriginTypeResolver
originTypeResolver
The origin type identifier to use.-
Fields inherited from class net.bytebuddy.implementation.Implementation.Target.AbstractBase
defaultMethodInvocation, instrumentedType, methodGraph
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubclassImplementationTarget(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation, SubclassImplementationTarget.OriginTypeResolver originTypeResolver)
Creates a new subclass implementation target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDefinition
getOriginType()
Identifies the origin type of an implementation.private Implementation.SpecialMethodInvocation
invokeConstructor(MethodDescription.SignatureToken token)
Resolves a special method invocation for a constructor invocation.private Implementation.SpecialMethodInvocation
invokeMethod(MethodDescription.SignatureToken token)
Resolves a special method invocation for a non-constructor invocation.Implementation.SpecialMethodInvocation
invokeSuper(MethodDescription.SignatureToken token)
Creates a special method invocation for invoking the super method of the given method.-
Methods inherited from class net.bytebuddy.implementation.Implementation.Target.AbstractBase
getInstrumentedType, invokeDefault, invokeDefault, invokeDominant
-
-
-
-
Field Detail
-
originTypeResolver
protected final SubclassImplementationTarget.OriginTypeResolver originTypeResolver
The origin type identifier to use.
-
-
Constructor Detail
-
SubclassImplementationTarget
protected SubclassImplementationTarget(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation, SubclassImplementationTarget.OriginTypeResolver originTypeResolver)
Creates a new subclass implementation target.- Parameters:
instrumentedType
- The instrumented type.methodGraph
- A method graph of the instrumented type.defaultMethodInvocation
- The default method invocation mode to apply.originTypeResolver
- A resolver for the origin type.
-
-
Method Detail
-
invokeSuper
public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token)
Creates a special method invocation for invoking the super method of the given method.- Parameters:
token
- A token of the method that is to be invoked as a super method.- Returns:
- The corresponding special method invocation which might be illegal if the requested invocation is not legal.
-
invokeConstructor
private Implementation.SpecialMethodInvocation invokeConstructor(MethodDescription.SignatureToken token)
Resolves a special method invocation for a constructor invocation.- Parameters:
token
- A token describing the constructor to be invoked.- Returns:
- A special method invocation for a constructor representing the given method token, if available.
-
invokeMethod
private Implementation.SpecialMethodInvocation invokeMethod(MethodDescription.SignatureToken token)
Resolves a special method invocation for a non-constructor invocation.- Parameters:
token
- A token describing the method to be invoked.- Returns:
- A special method invocation for a method representing the given method token, if available.
-
getOriginType
public TypeDefinition getOriginType()
Identifies the origin type of an implementation. The origin type describes the type that is subject to any form of enhancement. If a subclass of a given type is generated, the base type of this subclass describes the origin type. If a given type is redefined or rebased, the origin type is described by the instrumented type itself.- Returns:
- The origin type of this implementation.
-
-