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, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, 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 ClassLoaderprotected Class<?> findClass(String name) throws ClassNotFoundException
findClass in class URLClassLoaderClassNotFoundExceptionprotected Class<?> maybeInstrumentClass(String className) throws ClassNotFoundException
ClassNotFoundExceptionprotected byte[] postProcessUninstrumentedClass(MutableClass mutableClass, byte[] origClassBytes)
protected Package getPackage(String name)
getPackage in class ClassLoaderprotected byte[] getByteCode(String className) throws ClassNotFoundException
ClassNotFoundException