Class SubclassBytecodeGenerator
- java.lang.Object
-
- org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator
-
- All Implemented Interfaces:
BytecodeGenerator
class SubclassBytecodeGenerator extends java.lang.Object implements BytecodeGenerator
-
-
Field Summary
Fields Modifier and Type Field Description private net.bytebuddy.ByteBuddy
byteBuddy
private static java.lang.String
CODEGEN_PACKAGE
private net.bytebuddy.implementation.Implementation
dispatcher
private net.bytebuddy.implementation.Implementation
equals
private ModuleHandler
handler
private net.bytebuddy.implementation.Implementation
hashCode
private SubclassLoader
loader
private net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription>
matcher
private java.util.Random
random
private net.bytebuddy.implementation.Implementation
readReplace
private net.bytebuddy.implementation.Implementation
writeReplace
-
Constructor Summary
Constructors Modifier Constructor Description SubclassBytecodeGenerator()
SubclassBytecodeGenerator(net.bytebuddy.implementation.Implementation readReplace, net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher)
SubclassBytecodeGenerator(SubclassLoader loader)
protected
SubclassBytecodeGenerator(SubclassLoader loader, net.bytebuddy.implementation.Implementation readReplace, net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
assertVisibility(java.lang.Class<?> type)
private <T> java.util.Collection<java.lang.Class<? super T>>
getAllTypes(java.lang.Class<T> type)
private static boolean
hasNonPublicTypeReference(java.lang.Class<?> iface)
private boolean
isComingFromJDK(java.lang.Class<?> type)
private static net.bytebuddy.matcher.ElementMatcher<net.bytebuddy.description.method.MethodDescription>
isGroovyMethod()
<T> java.lang.Class<? extends T>
mockClass(MockFeatures<T> features)
void
mockClassConstruction(java.lang.Class<?> type)
void
mockClassStatic(java.lang.Class<?> type)
private static boolean
needsSamePackageClassLoader(MockFeatures<?> features)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mockito.internal.creation.bytebuddy.BytecodeGenerator
clearAllCaches
-
-
-
-
Field Detail
-
CODEGEN_PACKAGE
private static final java.lang.String CODEGEN_PACKAGE
- See Also:
- Constant Field Values
-
loader
private final SubclassLoader loader
-
handler
private final ModuleHandler handler
-
byteBuddy
private final net.bytebuddy.ByteBuddy byteBuddy
-
random
private final java.util.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 Detail
-
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 Detail
-
needsSamePackageClassLoader
private static boolean needsSamePackageClassLoader(MockFeatures<?> features)
-
hasNonPublicTypeReference
private static boolean hasNonPublicTypeReference(java.lang.Class<?> iface)
-
mockClass
public <T> java.lang.Class<? extends T> mockClass(MockFeatures<T> features)
- Specified by:
mockClass
in interfaceBytecodeGenerator
-
mockClassStatic
public void mockClassStatic(java.lang.Class<?> type)
- Specified by:
mockClassStatic
in interfaceBytecodeGenerator
-
mockClassConstruction
public void mockClassConstruction(java.lang.Class<?> type)
- Specified by:
mockClassConstruction
in interfaceBytecodeGenerator
-
getAllTypes
private <T> java.util.Collection<java.lang.Class<? super T>> getAllTypes(java.lang.Class<T> type)
-
isGroovyMethod
private static net.bytebuddy.matcher.ElementMatcher<net.bytebuddy.description.method.MethodDescription> isGroovyMethod()
-
isComingFromJDK
private boolean isComingFromJDK(java.lang.Class<?> type)
-
assertVisibility
private static void assertVisibility(java.lang.Class<?> type)
-
-