Class ClasspathClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- net.sourceforge.pmd.internal.util.ClasspathClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ClasspathClassLoader extends URLClassLoader
Create a ClassLoader which loads classes using a CLASSPATH like String. If the String looks like a URL to a file (e.g. starts withfile://
) the file will be read with each line representing an path on the classpath.- Author:
- Edwin Chan
-
-
Constructor Summary
Constructors Constructor Description ClasspathClassLoader(String classpath, ClassLoader parent)
ClasspathClassLoader(List<File> files, ClassLoader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>
loadClass(String name, boolean resolve)
String
toString()
-
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
ClasspathClassLoader
public ClasspathClassLoader(List<File> files, ClassLoader parent) throws IOException
- Throws:
IOException
-
ClasspathClassLoader
public ClasspathClassLoader(String classpath, ClassLoader parent) throws IOException
- Throws:
IOException
-
-
Method Detail
-
loadClass
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
-