Class RebaseImplementationTarget

java.lang.Object
net.bytebuddy.implementation.Implementation.Target.AbstractBase
net.bytebuddy.dynamic.scaffold.inline.RebaseImplementationTarget
All Implemented Interfaces:
Implementation.Target

@Enhance public class RebaseImplementationTarget extends Implementation.Target.AbstractBase
An implementation target for redefining a given type while preserving the original methods within the instrumented type.

 

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.
  • Field Details

  • Constructor Details

  • Method Details

    • of

      protected static Implementation.Target of(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, ClassFileVersion classFileVersion, MethodRebaseResolver methodRebaseResolver)
      Creates a new rebase implementation target.
      Parameters:
      instrumentedType - The instrumented type.
      methodGraph - A method graph of the instrumented type.
      classFileVersion - The type's class file version.
      methodRebaseResolver - A method rebase resolver to be used when calling a rebased method.
      Returns:
      An implementation target for the given input.
    • invokeSuper

      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.
    • invokeSuper

      Creates a special method invocation for the given node.
      Parameters:
      node - The node for which a special method invocation is to be created.
      Returns:
      A special method invocation for the provided node.
    • invokeSuper

      Creates a special method invocation for the given rebase resolution.
      Parameters:
      resolution - The resolution for which a special method invocation is to be created.
      Returns:
      A special method invocation for the provided resolution.
    • getOriginType

      public TypeDescription 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.