Class SubclassBytecodeGenerator

java.lang.Object
org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator
All Implemented Interfaces:
BytecodeGenerator

class SubclassBytecodeGenerator extends Object implements BytecodeGenerator
  • Field Details

    • CODEGEN_PACKAGE

      private static final String CODEGEN_PACKAGE
      See Also:
    • loader

      private final SubclassLoader loader
    • handler

      private final ModuleHandler handler
    • byteBuddy

      private final net.bytebuddy.ByteBuddy byteBuddy
    • random

      private final Random random
    • readReplace

      private final net.bytebuddy.implementation.Implementation readReplace
    • matcher

      private final net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher
    • dispatcher

      private final net.bytebuddy.implementation.Implementation dispatcher
    • hashCode

      private final net.bytebuddy.implementation.Implementation hashCode
    • equals

      private final net.bytebuddy.implementation.Implementation equals
    • writeReplace

      private final net.bytebuddy.implementation.Implementation writeReplace
  • Constructor Details

    • SubclassBytecodeGenerator

      public SubclassBytecodeGenerator()
    • SubclassBytecodeGenerator

      public SubclassBytecodeGenerator(SubclassLoader loader)
    • SubclassBytecodeGenerator

      public SubclassBytecodeGenerator(net.bytebuddy.implementation.Implementation readReplace, net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher)
    • SubclassBytecodeGenerator

      protected SubclassBytecodeGenerator(SubclassLoader loader, net.bytebuddy.implementation.Implementation readReplace, net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher)
  • Method Details

    • needsSamePackageClassLoader

      private static boolean needsSamePackageClassLoader(MockFeatures<?> features)
    • hasNonPublicTypeReference

      private static boolean hasNonPublicTypeReference(Class<?> iface)
    • mockClass

      public <T> Class<? extends T> mockClass(MockFeatures<T> features)
      Specified by:
      mockClass in interface BytecodeGenerator
    • mockClassStatic

      public void mockClassStatic(Class<?> type)
      Specified by:
      mockClassStatic in interface BytecodeGenerator
    • mockClassConstruction

      public void mockClassConstruction(Class<?> type)
      Specified by:
      mockClassConstruction in interface BytecodeGenerator
    • getAllTypes

      private <T> Collection<Class<? super T>> getAllTypes(Class<T> type)
    • isGroovyMethod

      private static net.bytebuddy.matcher.ElementMatcher<net.bytebuddy.description.method.MethodDescription> isGroovyMethod()
    • isComingFromJDK

      private boolean isComingFromJDK(Class<?> type)
    • assertVisibility

      private static void assertVisibility(Class<?> type)