Class BaseClassModifier

Direct Known Subclasses:
BaseSubclassGenerator, InterfaceImplementationGenerator

public class BaseClassModifier extends WrappingClassVisitor
  • Field Details

    • VOID_TYPE

      protected static final JavaType VOID_TYPE
    • methodAnnotationsVisitor

      @NonNull protected final MethodVisitor methodAnnotationsVisitor
    • mw

      protected MethodWriter mw
    • useClassLoadingBridge

      protected boolean useClassLoadingBridge
    • superClassName

      protected String superClassName
    • classDesc

      protected String classDesc
    • methodAccess

      protected int methodAccess
    • methodName

      protected String methodName
    • methodDesc

      protected String methodDesc
  • Constructor Details

    • BaseClassModifier

      protected BaseClassModifier(@NonNull ClassReader classReader)
  • Method Details

    • setUseClassLoadingBridge

      protected final void setUseClassLoadingBridge(@Nullable ClassLoader classLoader)
    • visit

      public void visit(int version, int access, @NonNull String name, @NonNull ClassInfo additionalInfo)
      Description copied from class: ClassVisitor
      Visits the header of the class.
      Overrides:
      visit in class WrappingClassVisitor
      Parameters:
      version - the class version
      access - the class's access flags (see Access)
      name - the internal name of the class
      additionalInfo - additional class information
    • startModifiedMethodVersion

      protected final void startModifiedMethodVersion(int access, @NonNull String name, @NonNull String desc, @Nullable String signature, @Nullable String[] exceptions)
      Just creates a new MethodWriter which will write out the method bytecode when visited.

      Removes any "abstract" or "native" modifiers for the modified version.

    • wasModified

      public final boolean wasModified()
    • generateDirectCallToHandler

      protected final void generateDirectCallToHandler(@NonNull String className, int access, @NonNull String name, @NonNull String desc, @Nullable String genericSignature)
    • generateDirectCallToHandler

      protected final void generateDirectCallToHandler(@NonNull String className, int access, @NonNull String name, @NonNull String desc, @Nullable String genericSignature, @NonNull ExecutionMode executionMode)
    • generateReturnWithObjectAtTopOfTheStack

      protected final void generateReturnWithObjectAtTopOfTheStack(@NonNull String mockedMethodDesc)
    • generateCodeToPassThisOrNullIfStaticMethod

      protected final boolean generateCodeToPassThisOrNullIfStaticMethod()
    • generateCodeToCreateArrayOfObject

      protected final void generateCodeToCreateArrayOfObject(@org.checkerframework.checker.index.qual.NonNegative int arrayLength)
    • generateCodeToFillArrayWithParameterValues

      protected final void generateCodeToFillArrayWithParameterValues(@NonNull JavaType[] parameterTypes, @org.checkerframework.checker.index.qual.NonNegative int initialArrayIndex, @org.checkerframework.checker.index.qual.NonNegative int initialParameterIndex)
    • generateCodeToObtainInstanceOfClassLoadingBridge

      protected final void generateCodeToObtainInstanceOfClassLoadingBridge(@NonNull ClassLoadingBridge classLoadingBridge)
    • generateCodeToFillArrayElement

      protected final void generateCodeToFillArrayElement(@org.checkerframework.checker.index.qual.NonNegative int arrayIndex, @Nullable Object value)
    • generateCallToInvocationHandler

      protected final void generateCallToInvocationHandler()
    • generateEmptyImplementation

      protected final void generateEmptyImplementation(@NonNull String desc)
    • generateEmptyImplementation

      protected final void generateEmptyImplementation()
    • copyOriginalImplementationWithInjectedInterceptionCode

      @NonNull protected final MethodVisitor copyOriginalImplementationWithInjectedInterceptionCode()
    • generateInterceptionCode

      protected void generateInterceptionCode()