Top Description Inners Fields Constructors Methods
net.bytebuddy.dynamic.scaffold.subclass

public Class SubclassImplementationTarget

extends AbstractBase
Class Inheritance
Annotations
@Enhance
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.ClassFileVersion, net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.method.MethodDescription, .MethodList, net.bytebuddy.description.type.TypeDefinition, .TypeDescription, net.bytebuddy.dynamic.scaffold.MethodGraph, net.bytebuddy.implementation.Implementation

An implementation target for creating a subclass of a given type.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum
SubclassImplementationTarget.OriginTypeResolver

Responsible for identifying the origin type that an implementation target represents when Implementation.Target#getOriginType() is invoked.

Field Summary

Modifier and TypeField and Description
protected final SubclassImplementationTarget.OriginTypeResolver
originTypeResolver

The origin type identifier to use.

Inherited from net.bytebuddy.implementation.Implementation.Target.AbstractBase:
defaultMethodInvocationinstrumentedTypemethodGraph

Constructor Summary

AccessConstructor and Description
protected
SubclassImplementationTarget(TypeDescription
The instrumented type.
instrumentedType
,
MethodGraph.Linked
A method graph of the instrumented type.
methodGraph
,
Implementation.Target.AbstractBase.DefaultMethodInvocation
The default method invocation mode to apply.
defaultMethodInvocation
,
SubclassImplementationTarget.OriginTypeResolver
A resolver for the origin type.
originTypeResolver
)

Creates a new subclass implementation target.

Method Summary

Modifier and TypeMethod and Description
public TypeDefinition
getOriginType()

Implements net.bytebuddy.implementation.Implementation.Target.getOriginType.

Identifies the origin type of an implementation.
private Implementation.SpecialMethodInvocation

Returns:

A special method invocation for a constructor representing the given method token, if available.
invokeConstructor
(MethodDescription.SignatureToken
A token describing the constructor to be invoked.
token
)

Resolves a special method invocation for a constructor invocation.

private Implementation.SpecialMethodInvocation

Returns:

A special method invocation for a method representing the given method token, if available.
invokeMethod
(MethodDescription.SignatureToken
A token describing the method to be invoked.
token
)

Resolves a special method invocation for a non-constructor invocation.

public Implementation.SpecialMethodInvocation
invokeSuper(MethodDescription.SignatureToken
A token of the method that is to be invoked as a super method.
token
)

Implements net.bytebuddy.implementation.Implementation.Target.invokeSuper.

Creates a special method invocation for invoking the super method of the given method.
Inherited from net.bytebuddy.implementation.Implementation.Target.AbstractBase:
getInstrumentedTypeinvokeDefaultinvokeDefaultinvokeDominant

Field Detail

originTypeResolverback to summary
protected final SubclassImplementationTarget.OriginTypeResolver originTypeResolver

The origin type identifier to use.

Constructor Detail

SubclassImplementationTargetback to summary
protected SubclassImplementationTarget(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, Implementation.Target.AbstractBase.DefaultMethodInvocation defaultMethodInvocation, SubclassImplementationTarget.OriginTypeResolver originTypeResolver)

Creates a new subclass implementation target.

Parameters
instrumentedType:TypeDescription

The instrumented type.

methodGraph:MethodGraph.Linked

A method graph of the instrumented type.

defaultMethodInvocation:Implementation.Target.AbstractBase.DefaultMethodInvocation

The default method invocation mode to apply.

originTypeResolver:SubclassImplementationTarget.OriginTypeResolver

A resolver for the origin type.

Method Detail

getOriginTypeback to summary
public TypeDefinition getOriginType()

Implements net.bytebuddy.implementation.Implementation.Target.getOriginType.

Doc from net.bytebuddy.implementation.Implementation.Target.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:TypeDefinition

The origin type of this implementation.

invokeConstructorback to summary
private Implementation.SpecialMethodInvocation invokeConstructor(MethodDescription.SignatureToken token)

Resolves a special method invocation for a constructor invocation.

Parameters
token:MethodDescription.SignatureToken

A token describing the constructor to be invoked.

Returns:Implementation.SpecialMethodInvocation

A special method invocation for a constructor representing the given method token, if available.

invokeMethodback to summary
private Implementation.SpecialMethodInvocation invokeMethod(MethodDescription.SignatureToken token)

Resolves a special method invocation for a non-constructor invocation.

Parameters
token:MethodDescription.SignatureToken

A token describing the method to be invoked.

Returns:Implementation.SpecialMethodInvocation

A special method invocation for a method representing the given method token, if available.

Annotations
@SuppressFBWarnings:NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
justification:Assuming super class for given instance.
invokeSuperback to summary
public Implementation.SpecialMethodInvocation invokeSuper(MethodDescription.SignatureToken token)

Implements net.bytebuddy.implementation.Implementation.Target.invokeSuper.

Doc from net.bytebuddy.implementation.Implementation.Target.invokeSuper.

Creates a special method invocation for invoking the super method of the given method.

Parameters
token:MethodDescription.SignatureToken

A token of the method that is to be invoked as a super method.

Returns:Implementation.SpecialMethodInvocation

The corresponding special method invocation which might be illegal if the requested invocation is not legal.

net.bytebuddy.dynamic.scaffold.subclass back to summary

public final Enum SubclassImplementationTarget.Factory

extends Enum<SubclassImplementationTarget.Factory>
implements Factory
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.Implementation.Target.Factory

A factory for creating a net.bytebuddy.dynamic.scaffold.subclass.SubclassImplementationTarget.

Field Summary

Modifier and TypeField and Description
public static final SubclassImplementationTarget.Factory
LEVEL_TYPE

A factory creating a subclass implementation target with a OriginTypeResolver#LEVEL_TYPE.

private final SubclassImplementationTarget.OriginTypeResolver
originTypeResolver

The origin type resolver that this factory hands to the created SubclassImplementationTarget.

public static final SubclassImplementationTarget.Factory
SUPER_CLASS

A factory creating a subclass implementation target with a OriginTypeResolver#SUPER_CLASS.

Constructor Summary

AccessConstructor and Description
private
Factory(SubclassImplementationTarget.OriginTypeResolver
The origin type resolver that this factory hands to the created SubclassImplementationTarget.
originTypeResolver
)

Creates a new factory.

Method Summary

Modifier and TypeMethod and Description
public Implementation.Target
make(TypeDescription
The instrumented type.
instrumentedType
,
MethodGraph.Linked
A method graph of the instrumented type.
methodGraph
,
ClassFileVersion
The type's class file version.
classFileVersion
)

Implements net.bytebuddy.implementation.Implementation.Target.Factory.make.

Creates an implementation target.
public static SubclassImplementationTarget.Factory
public static SubclassImplementationTarget.Factory[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LEVEL_TYPEback to summary
public static final SubclassImplementationTarget.Factory LEVEL_TYPE

A factory creating a subclass implementation target with a OriginTypeResolver#LEVEL_TYPE.

originTypeResolverback to summary
private final SubclassImplementationTarget.OriginTypeResolver originTypeResolver

The origin type resolver that this factory hands to the created SubclassImplementationTarget.

SUPER_CLASSback to summary
public static final SubclassImplementationTarget.Factory SUPER_CLASS

A factory creating a subclass implementation target with a OriginTypeResolver#SUPER_CLASS.

Constructor Detail

Factoryback to summary
private Factory(SubclassImplementationTarget.OriginTypeResolver originTypeResolver)

Creates a new factory.

Parameters
originTypeResolver:SubclassImplementationTarget.OriginTypeResolver

The origin type resolver that this factory hands to the created SubclassImplementationTarget.

Method Detail

makeback to summary
public Implementation.Target make(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, ClassFileVersion classFileVersion)

Implements net.bytebuddy.implementation.Implementation.Target.Factory.make.

Doc from net.bytebuddy.implementation.Implementation.Target.Factory.make.

Creates an implementation target.

Parameters
instrumentedType:TypeDescription

The instrumented type.

methodGraph:MethodGraph.Linked

A method graph of the instrumented type.

classFileVersion:ClassFileVersion

The type's class file version.

Returns:Implementation.Target

An implementation target for the instrumented type.

valueOfback to summary
public static SubclassImplementationTarget.Factory valueOf(String name)
valuesback to summary
public static SubclassImplementationTarget.Factory[] values()
net.bytebuddy.dynamic.scaffold.subclass back to summary

public sealed Enum SubclassImplementationTarget.OriginTypeResolver

extends Enum<SubclassImplementationTarget.OriginTypeResolver>
Class Inheritance

Responsible for identifying the origin type that an implementation target represents when Implementation.Target#getOriginType() is invoked.

Field Summary

Modifier and TypeField and Description
public static final SubclassImplementationTarget.OriginTypeResolver
LEVEL_TYPE

Identifies the instrumented type as its own origin type.

public static final SubclassImplementationTarget.OriginTypeResolver
SUPER_CLASS

Identifies the super type of an instrumented type as the origin class.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected abstract TypeDefinition

Returns:

The origin type to the given type description.
identify
(TypeDescription
The type description for which an origin type should be identified.
typeDescription
)

Identifies the origin type to a given type description.

public static SubclassImplementationTarget.OriginTypeResolver
public static SubclassImplementationTarget.OriginTypeResolver[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LEVEL_TYPEback to summary
public static final SubclassImplementationTarget.OriginTypeResolver LEVEL_TYPE

Identifies the instrumented type as its own origin type.

SUPER_CLASSback to summary
public static final SubclassImplementationTarget.OriginTypeResolver SUPER_CLASS

Identifies the super type of an instrumented type as the origin class.

Constructor Detail

OriginTypeResolverback to summary
private OriginTypeResolver()

Method Detail

identifyback to summary
protected abstract TypeDefinition identify(TypeDescription typeDescription)

Identifies the origin type to a given type description.

Parameters
typeDescription:TypeDescription

The type description for which an origin type should be identified.

Returns:TypeDefinition

The origin type to the given type description.

valueOfback to summary
public static SubclassImplementationTarget.OriginTypeResolver valueOf(String name)
valuesback to summary
public static SubclassImplementationTarget.OriginTypeResolver[] values()