public class SandboxClassLoader extends URLClassLoader
Class loader that modifies the bytecode of Android classes to insert calls to Robolectric’s shadow classes.
Constructor and Description |
---|
SandboxClassLoader(ClassLoader erstwhileClassLoader,
InstrumentationConfiguration config,
ResourceProvider resourceProvider,
ClassInstrumentor classInstrumentor) |
SandboxClassLoader(InstrumentationConfiguration config,
ResourceProvider resourceProvider,
ClassInstrumentor classInstrumentor) |
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
findClass(String name) |
protected byte[] |
getByteCode(String className) |
protected Package |
getPackage(String name) |
URL |
getResource(String name) |
protected Class<?> |
maybeInstrumentClass(String className) |
protected byte[] |
postProcessUninstrumentedClass(MutableClass mutableClass,
byte[] origClassBytes) |
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
@Inject public SandboxClassLoader(InstrumentationConfiguration config, ResourceProvider resourceProvider, ClassInstrumentor classInstrumentor)
public SandboxClassLoader(ClassLoader erstwhileClassLoader, InstrumentationConfiguration config, ResourceProvider resourceProvider, ClassInstrumentor classInstrumentor)
public URL getResource(String name)
getResource
in class ClassLoader
protected Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
ClassNotFoundException
protected Class<?> maybeInstrumentClass(String className) throws ClassNotFoundException
ClassNotFoundException
protected byte[] postProcessUninstrumentedClass(MutableClass mutableClass, byte[] origClassBytes)
protected Package getPackage(String name)
getPackage
in class ClassLoader
protected byte[] getByteCode(String className) throws ClassNotFoundException
ClassNotFoundException