public class SandboxClassLoader
extends java.net.URLClassLoader
Class loader that modifies the bytecode of Android classes to insert calls to Robolectric’s shadow classes.
Constructor and Description |
---|
SandboxClassLoader(java.lang.ClassLoader systemClassLoader,
InstrumentationConfiguration config,
java.net.URL... urls) |
SandboxClassLoader(InstrumentationConfiguration config) |
Modifier and Type | Method and Description |
---|---|
protected ClassInstrumentor |
createClassInstrumentor(ClassInstrumentor.Decorator decorator) |
protected java.lang.Class<?> |
findClass(java.lang.String name) |
protected byte[] |
getByteCode(java.lang.String className) |
protected java.lang.Package |
getPackage(java.lang.String name) |
java.net.URL |
getResource(java.lang.String name) |
protected java.lang.Class<?> |
maybeInstrumentClass(java.lang.String className) |
protected byte[] |
postProcessUninstrumentedClass(MutableClass mutableClass,
byte[] origClassBytes) |
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
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
public SandboxClassLoader(InstrumentationConfiguration config)
public SandboxClassLoader(java.lang.ClassLoader systemClassLoader, InstrumentationConfiguration config, java.net.URL... urls)
protected ClassInstrumentor createClassInstrumentor(ClassInstrumentor.Decorator decorator)
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
protected java.lang.Class<?> findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.net.URLClassLoader
java.lang.ClassNotFoundException
protected java.lang.Class<?> maybeInstrumentClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected byte[] postProcessUninstrumentedClass(MutableClass mutableClass, byte[] origClassBytes)
protected java.lang.Package getPackage(java.lang.String name)
getPackage
in class java.lang.ClassLoader
protected byte[] getByteCode(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException