Class SubclassInjectionLoader
- java.lang.Object
-
- org.mockito.internal.creation.bytebuddy.SubclassInjectionLoader
-
- All Implemented Interfaces:
SubclassLoader
class SubclassInjectionLoader extends java.lang.Object implements SubclassLoader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSubclassInjectionLoader.WithLookupprivate static classSubclassInjectionLoader.WithReflection
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringERROR_MESSAGEprivate SubclassLoaderloader
-
Constructor Summary
Constructors Constructor Description SubclassInjectionLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisDisrespectingOpenness()Checks if this loader does not require a module to be open.net.bytebuddy.dynamic.loading.ClassLoadingStrategy<java.lang.ClassLoader>resolveStrategy(java.lang.Class<?> mockedType, java.lang.ClassLoader classLoader, boolean localMock)Resolves a class loading strategy.private static SubclassLoadertryLookup()
-
-
-
Field Detail
-
ERROR_MESSAGE
private static final java.lang.String ERROR_MESSAGE
-
loader
private final SubclassLoader loader
-
-
Method Detail
-
tryLookup
private static SubclassLoader tryLookup()
-
isDisrespectingOpenness
public boolean isDisrespectingOpenness()
Description copied from interface:SubclassLoaderChecks if this loader does not require a module to be open.- Specified by:
isDisrespectingOpennessin interfaceSubclassLoader- Returns:
trueif this loader is not constraint to a target module being opened for loading a class.
-
resolveStrategy
public net.bytebuddy.dynamic.loading.ClassLoadingStrategy<java.lang.ClassLoader> resolveStrategy(java.lang.Class<?> mockedType, java.lang.ClassLoader classLoader, boolean localMock)Description copied from interface:SubclassLoaderResolves a class loading strategy.- Specified by:
resolveStrategyin interfaceSubclassLoader- Parameters:
mockedType- The type being mocked.classLoader- The class loader being used.localMock-trueif the mock is loaded within the runtime package of the mocked type.- Returns:
- An appropriate class loading strategy.
-
-