Package eu.bandm.tools.util.classes
Class ConfigurableClassLoader.JarArchive
java.lang.Object
eu.bandm.tools.util.classes.ConfigurableClassLoader.ClassSource
eu.bandm.tools.util.classes.ConfigurableClassLoader.JarArchive
- Enclosing class:
- ConfigurableClassLoader
A jar archive from which a class can be loaded.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final @Opt ClassLoader
The loader to which the jar file class loader delegates according to its "Class-Path" manifest entry.protected final JarFile
A jar file (in the local file system) starting from which this class loader will resolve class names. -
Constructor Summary
ConstructorDescriptionJarArchive
(File root) Only constructor, sets the jar file from which this class loader will resolve class names. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Returns the class object, if the class with the given name is found at this position.protected Class<?>
findClassHere
(String name) Load the class from the jar file only (not delegated tolocalLoader
.protected @Opt InputStream
Return an input stream which contains all data of the class with the given name.protected String
toPhysicalName
(String name) Convert a class name to the file name valid relative to this class loader.Methods inherited from class eu.bandm.tools.util.classes.ConfigurableClassLoader.ClassSource
getClassData
-
Field Details
-
root
A jar file (in the local file system) starting from which this class loader will resolve class names. -
localLoader
The loader to which the jar file class loader delegates according to its "Class-Path" manifest entry.
-
-
Constructor Details
-
JarArchive
Only constructor, sets the jar file from which this class loader will resolve class names.- Throws:
IOException
-
-
Method Details
-
findClass
Returns the class object, if the class with the given name is found at this position. If the class is not found directly in the jar file, the local loader is consulted, which corresponds to the "Class-Path" attribute in the jar file's manifest.- Overrides:
findClass
in classConfigurableClassLoader.ClassSource
- Parameters:
name
- the binary class name of the class- Returns:
- the class as created by
ClassLoader.defineClass(byte[], int, int)
- Throws:
ClassNotFoundException
- iff no class with the given name is found.
-
findClassHere
Load the class from the jar file only (not delegated tolocalLoader
.- Throws:
ClassNotFoundException
-
openClass
Return an input stream which contains all data of the class with the given name.- Specified by:
openClass
in classConfigurableClassLoader.ClassSource
- Parameters:
name
- the binary class name to be loaded by this class loader- Throws:
IOException
- if no file corresponding to the class name can be found.
-
toPhysicalName
Convert a class name to the file name valid relative to this class loader.
-