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, 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 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