java.lang.Object
java.lang.ClassLoader
org.gjt.sp.jedit.JARClassLoader
A class loader implementation that loads classes from JAR files. All
instances share the same set of classes.
- Version:
- $Id: JARClassLoader.java 24913 2019-07-28 18:32:11Z daleanson $
- Author:
- Slava Pestov
-
Constructor Summary
ConstructorDescriptionThis constructor creates a class loader for loading classes from all plugins.JARClassLoader
(boolean delegateFirst) Creates a class loader that will optionally delegate the finding of classes to the parent class loader by default. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
dump()
For debugging.protected void
finalize()
getResource
(String name) overriding getResource() because we want to search FIRST in this ClassLoader, then the parent, the path, etc.getResourceAsPath
(String name) construct a jeditresource:/etc path from the name of a resource in the associated jar.getResourceAsStream
(String name) getResources
(String name) toString()
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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
JARClassLoader
public JARClassLoader()This constructor creates a class loader for loading classes from all plugins. For example BeanShell uses one of these so that scripts can use plugin classes. -
JARClassLoader
public JARClassLoader(boolean delegateFirst) Creates a class loader that will optionally delegate the finding of classes to the parent class loader by default.- Since:
- jEdit 4.3pre6
-
-
Method Details
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
- if the class could not be found
-
getResourceAsStream
- Overrides:
getResourceAsStream
in classClassLoader
-
getResource
overriding getResource() because we want to search FIRST in this ClassLoader, then the parent, the path, etc.- Overrides:
getResource
in classClassLoader
-
getResourceAsPath
construct a jeditresource:/etc path from the name of a resource in the associated jar. The existence of the resource is not actually checked.- Parameters:
name
- name of the resource- Returns:
- jeditresource:/path_to_the_jar!name_of_the_resource
- Throws:
UnsupportedOperationException
- if this is an anonymous JARClassLoader (no associated jar).
-
dump
public static void dump()For debugging. -
toString
-
getResources
- Overrides:
getResources
in classClassLoader
- Returns:
- zero or one resource, as returned by getResource()
- Throws:
IOException
-
finalize
protected void finalize()
-