Super method calls are merely emulated by this
Implementation.Target
in order
to preserve Java's super call semantics a user would expect when invoking a super
-prefixed method. This
means that original methods are either moved to renamed private
methods which are never dispatched
virtually or they are invoked directly via the INVOKESPECIAL
invocation to explicitly forbid a virtual
dispatch.
Modifier and Type | Class and Description |
---|---|
public static class | RebaseImplementationTarget.Factory
A factory for creating a |
protected static class | RebaseImplementationTarget.RebasedMethodInvocation
A |
Modifier and Type | Field and Description |
---|---|
private final Map | rebaseableMethods
A mapping of the instrumented type's declared methods by each method's token. |
Access | Constructor and Description |
---|---|
protected | RebaseImplementationTarget(TypeDescription
The instrumented type. instrumentedType, MethodGraph.A method graph of the instrumented type. methodGraph,The default method invocation mode to apply. defaultMethodInvocation,A mapping of the instrumented type's declared methods by each method's token. rebaseableMethodsCreates a rebase implementation target. |
Modifier and Type | Method and Description |
---|---|
public TypeDescription | getOriginType()
Implements net. |
public Implementation. | invokeSuper(MethodDescription.
A token of the method that is to be invoked as a super method. tokenImplements net. |
private Implementation. | Returns: A special method invocation for the provided node.The node for which a special method invocation is to be created. nodeCreates a special method invocation for the given node. |
private Implementation. | Returns: A special method invocation for the provided resolution.The resolution for which a special method invocation is to be created. resolutionCreates a special method invocation for the given rebase resolution. |
protected static Implementation. | Returns: An implementation target for the given input.The instrumented type. instrumentedType, MethodGraph.A method graph of the instrumented type. methodGraph,The type's class file version. classFileVersion, MethodRebaseResolver A method rebase resolver to be used when calling a rebased method. methodRebaseResolver)Creates a new rebase implementation target. |
rebaseableMethods | back to summary |
---|---|
private final Map<MethodDescription. A mapping of the instrumented type's declared methods by each method's token. |
RebaseImplementationTarget | back to summary |
---|---|
protected RebaseImplementationTarget(TypeDescription instrumentedType, MethodGraph. Creates a rebase implementation target.
|
getOriginType | back to summary |
---|---|
public TypeDescription getOriginType() Implements net. Doc from net. 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.
|
invokeSuper | back to summary |
---|---|
public Implementation. Implements net. Doc from net. Creates a special method invocation for invoking the super method of the given method.
|
invokeSuper | back to summary |
---|---|
private Implementation. Creates a special method invocation for the given node.
|
invokeSuper | back to summary |
---|---|
private Implementation. Creates a special method invocation for the given rebase resolution.
|
of | back to summary |
---|---|
protected static Implementation. Creates a new rebase implementation target.
|
RebaseImplementationTarget
.
Modifier and Type | Field and Description |
---|---|
private final MethodRebaseResolver | methodRebaseResolver
The method rebase resolver to use. |
Access | Constructor and Description |
---|---|
public | Factory(MethodRebaseResolver
The method rebase resolver to use. methodRebaseResolver)Creates a new factory for a rebase implementation target. |
Modifier and Type | Method and Description |
---|---|
public Implementation. | make(TypeDescription
The instrumented type. instrumentedType, MethodGraph.A method graph of the instrumented type. methodGraph,The type's class file version. classFileVersion)Implements net. |
methodRebaseResolver | back to summary |
---|---|
private final MethodRebaseResolver methodRebaseResolver The method rebase resolver to use. |
Factory | back to summary |
---|---|
public Factory(MethodRebaseResolver methodRebaseResolver) Creates a new factory for a rebase implementation target.
|
make | back to summary |
---|---|
public Implementation. Implements net. Doc from net. Creates an implementation target.
|
Implementation.SpecialMethodInvocation
which invokes a rebased method
as given by a MethodRebaseResolver
.
Modifier and Type | Field and Description |
---|---|
private final TypeDescription | instrumentedType
The instrumented type on which the method should be invoked on. |
private final MethodDescription. | methodDescription
The method to invoke via a special method invocation. |
private final TypeList | prependedParameters
Any additional arguments that are to be provided to the rebased method. |
private final StackManipulation | stackManipulation
The stack manipulation to execute in order to invoke the rebased method. |
Access | Constructor and Description |
---|---|
protected | RebasedMethodInvocation(MethodDescription.
The method to invoke via a special method invocation. methodDescription,The instrumented type on which the method should be invoked on. instrumentedType, StackManipulation The stack manipulation to execute in order to invoke the rebased method. stackManipulation, TypeList Any additional arguments that are to be provided to the rebased method. prependedParameters)Creates a new rebased method invocation. |
Modifier and Type | Method and Description |
---|---|
public StackManipulation. | apply(MethodVisitor
The method visitor used to write the method implementation to. methodVisitor, Implementation.The context of the current implementation. implementationContextImplements net. |
public MethodDescription | getMethodDescription()
Implements net. |
public TypeDescription | getTypeDescription()
Implements net. |
protected static Implementation. | Returns: A special method invocation of the rebased method.The rebased method to be invoked. resolvedMethod,The instrumented type on which the method is to be invoked if it is non-static. instrumentedType, TypeList Any additional arguments that are to be provided to the rebased method. prependedParameters)Creates a special method invocation for the given method. |
public JavaConstant. | toMethodHandle()
Implements net. |
public Implementation. | withCheckedCompatibilityTo(MethodDescription.
The type token to check against. tokenImplements net. |
instrumentedType | back to summary |
---|---|
private final TypeDescription instrumentedType The instrumented type on which the method should be invoked on. |
methodDescription | back to summary |
---|---|
private final MethodDescription. The method to invoke via a special method invocation. |
prependedParameters | back to summary |
---|---|
private final TypeList prependedParameters Any additional arguments that are to be provided to the rebased method. |
stackManipulation | back to summary |
---|---|
private final StackManipulation stackManipulation The stack manipulation to execute in order to invoke the rebased method. |
RebasedMethodInvocation | back to summary |
---|---|
protected RebasedMethodInvocation(MethodDescription. Creates a new rebased method invocation.
|
apply | back to summary |
---|---|
public StackManipulation. Implements net. Doc from net. Applies the stack manipulation that is described by this instance.
|
getMethodDescription | back to summary |
---|---|
public MethodDescription getMethodDescription() Implements net. Doc from net. Returns the method that represents this special method invocation. This method can be different even for
equal special method invocations, dependent on the method that was used to request such an invocation by the
means of a
|
getTypeDescription | back to summary |
---|---|
public TypeDescription getTypeDescription() Implements net. Doc from net. Returns the target type the represented method is invoked on.
|
of | back to summary |
---|---|
protected static Implementation. Creates a special method invocation for the given method.
|
toMethodHandle | back to summary |
---|---|
public JavaConstant. Implements net. Doc from net. Returns a method handle representing this special method invocation.
|
withCheckedCompatibilityTo | back to summary |
---|---|
public Implementation. Implements net. Doc from net. Checks that this special method invocation is compatible with the supplied type representation.
|