public abstract class DecoratingClassLoader extends ClassLoader
OverridingClassLoader
and ShadowingClassLoader
,
providing common handling of excluded packages and classes.Constructor and Description |
---|
DecoratingClassLoader()
Create a new DecoratingClassLoader with no parent ClassLoader.
|
DecoratingClassLoader(ClassLoader parent)
Create a new DecoratingClassLoader using the given parent ClassLoader
for delegation.
|
Modifier and Type | Method and Description |
---|---|
void |
excludeClass(String className)
Add a class name to exclude from decoration (e.g.
|
void |
excludePackage(String packageName)
Add a package name to exclude from decoration (e.g.
|
protected boolean |
isExcluded(String className)
Determine whether the specified class is excluded from decoration
by this class loader.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public DecoratingClassLoader()
public DecoratingClassLoader(@Nullable ClassLoader parent)
public void excludePackage(String packageName)
Any class whose fully-qualified name starts with the name registered here will be handled by the parent ClassLoader in the usual fashion.
packageName
- the package name to excludepublic void excludeClass(String className)
Any class name registered here will be handled by the parent ClassLoader in the usual fashion.
className
- the class name to excludeprotected boolean isExcluded(String className)
The default implementation checks against excluded packages and classes.
className
- the class name to checkexcludePackage(java.lang.String)
,
excludeClass(java.lang.String)