org.powermock.core.classloader
Class DeferSupportingClassLoader
java.lang.Object
java.lang.ClassLoader
org.powermock.core.classloader.DeferSupportingClassLoader
- Direct Known Subclasses:
- MockClassLoader
public abstract class DeferSupportingClassLoader
- extends ClassLoader
Defers classloading of system classes to a delegate.
- Author:
- Johan Haleby, Jan Kronquist
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DeferSupportingClassLoader
public DeferSupportingClassLoader(ClassLoader classloader,
String[] deferPackages)
addIgnorePackage
public void addIgnorePackage(String... packagesToIgnore)
loadClass
protected Class<?> loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Overrides:
loadClass
in class ClassLoader
- Throws:
ClassNotFoundException
shouldDefer
protected boolean shouldDefer(String[] packages,
String name)
shouldIgnore
protected boolean shouldIgnore(Iterable<String> packages,
String name)
shouldIgnore
protected boolean shouldIgnore(String[] packages,
String name)
findResource
protected URL findResource(String name)
- Finds the resource with the specified name on the search path.
- Overrides:
findResource
in class ClassLoader
- Parameters:
name
- the name of the resource
- Returns:
- a
URL
for the resource, or null
if the
resource could not be found.
shouldModify
protected boolean shouldModify(Iterable<String> packages,
String name)
loadModifiedClass
protected abstract Class<?> loadModifiedClass(String s)
throws ClassFormatError,
ClassNotFoundException
- Throws:
ClassFormatError
ClassNotFoundException
shouldModifyClass
protected abstract boolean shouldModifyClass(String s)
shouldLoadUnmodifiedClass
protected abstract boolean shouldLoadUnmodifiedClass(String className)
Copyright © 2007-2012. All Rights Reserved.