Package javassist
Class LoaderClassPath
java.lang.Object
javassist.LoaderClassPath
- All Implemented Interfaces:
ClassPath
A class search-path representing a class loader.
It is used for obtaining a class file from the given
class loader by getResourceAsStream().
The LoaderClassPath refers to the class loader through
WeakReference. If the class loader is garbage collected,
the other search pathes are examined.
The given class loader must have both getResourceAsStream()
and getResource().
Class files in a named module are private to that module. This method cannot obtain class files in named modules.
- Author:
- Bill Burke, Shigeru Chiba
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a search path representing a class loader. -
Method Summary
Modifier and TypeMethodDescriptionObtains the URL of the specified class file.openClassfile(String classname) Obtains a class file from the class loader.toString()
-
Constructor Details
-
LoaderClassPath
Creates a search path representing a class loader.
-
-
Method Details
-
toString
-
openClassfile
Obtains a class file from the class loader. This method callsgetResourceAsStream(String)on the class loader.- Specified by:
openClassfilein interfaceClassPath- Parameters:
classname- a fully-qualified class name- Returns:
- the input stream for reading a class file
- Throws:
NotFoundException- See Also:
-
find
Obtains the URL of the specified class file. This method callsgetResource(String)on the class loader.
-