Package com.sun.javatest.util
Class PathClassLoader
java.lang.Object
java.lang.ClassLoader
com.sun.javatest.util.PathClassLoader
A class loader for loading classes from a path of directories,
zip files and jar files.
-
Constructor Summary
ConstructorsConstructorDescriptionPathClassLoader
(File... path) Create a PathCloader, specifying an array of files for the path.PathClassLoader
(File baseDir, String pathString) Create a PathClassLoader, specifying a path and a base directory for any relative files on the path.PathClassLoader
(String pathString) Create a PathClassLoader, specifying a path. -
Method Summary
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
PathClassLoader
Create a PathClassLoader, specifying a path.- Parameters:
pathString
- a string containing a sequence of file paths separated by the platform-specific file separator, identifying a sequence of locations in which to look for classes to be loaded- See Also:
-
PathClassLoader
Create a PathClassLoader, specifying a path and a base directory for any relative files on the path.- Parameters:
baseDir
- the base directory for any relative files on the pathpathString
- a string containing a sequence of file paths separated by the platform-specific file separator, identifying a sequence of locations in which to look for classes to be loaded- See Also:
-
PathClassLoader
Create a PathCloader, specifying an array of files for the path.- Parameters:
path
- an array of files, identifying a sequence of locations in which to look for classes to be loaded
-
-
Method Details
-
loadClass
Attempt to load a class if it is not already loaded, and optionally resolve any imports it might have.- Overrides:
loadClass
in classClassLoader
- Parameters:
name
- The fully-qualified name of the class to load.resolve
- True if imports should be resolved, false otherwise.- Returns:
- the class that was loaded
- Throws:
ClassNotFoundException
- if the class was not found.
-