BshClassLoader (jEdit API Documentation)
Date: 2015-10-20

org.gjt.sp.jedit.bsh.classpath

## Class BshClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - java.security.SecureClassLoader
    - - java.net.URLClassLoader
      - - org.gjt.sp.jedit.bsh.classpath.BshClassLoader

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
  Direct Known Subclasses:
    DiscreteFilesClassLoader

      public class BshClassLoader
      extends java.net.URLClassLoader

  One of the things BshClassLoader does is to address a deficiency in URLClassLoader that prevents us from specifying individual classes via URLs.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BshClassLoader(BshClassManager classManager)` For use by children
    `` | `BshClassLoader(BshClassManager classManager, BshClassPath bcp)`
    `` | `BshClassLoader(BshClassManager classManager, java.net.URL[] bases)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addURL(java.net.URL url)`
    `protected java.lang.Class` | `findClass(java.lang.String name)` Find the correct source for the class...
    `java.lang.Class` | `loadClass(java.lang.String name, boolean resolve)` This modification allows us to reload classes which are in the Java VM user classpath.

    - ### Methods inherited from class java.net.URLClassLoader

      `close, definePackage, 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, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BshClassLoader

          public BshClassLoader(BshClassManager classManager,
                                java.net.URL[] bases)

      Parameters:
        `bases` - URLs JARClassLoader seems to require absolute paths

    - #### BshClassLoader

          public BshClassLoader(BshClassManager classManager,
                                BshClassPath bcp)

      Parameters:
        `bcp` - URLs JARClassLoader seems to require absolute paths

    - #### BshClassLoader

          protected BshClassLoader(BshClassManager classManager)

      For use by children
      Parameters:
        `classManager` - URLs JARClassLoader seems to require absolute paths

  - ### Method Detail

    - #### addURL

          public void addURL(java.net.URL url)

      Overrides:
        `addURL` in class `java.net.URLClassLoader`

    - #### loadClass

          public java.lang.Class loadClass(java.lang.String name,
                                           boolean resolve)
                                    throws java.lang.ClassNotFoundException

      This modification allows us to reload classes which are in the Java VM user classpath. We search first rather than delegate to the parent classloader (or bootstrap path) first. An exception is for BeanShell core classes which are always loaded from the same classloader as the interpreter.
      Overrides:
        `loadClass` in class `java.lang.ClassLoader`
      Throws:
        `java.lang.ClassNotFoundException`

    - #### findClass

          protected java.lang.Class findClass(java.lang.String name)
                                       throws java.lang.ClassNotFoundException

      Find the correct source for the class... Try designated loader if any Try our URLClassLoader paths if any Try base loader if any Try system ???
      Overrides:
        `findClass` in class `java.net.URLClassLoader`
      Throws:
        `java.lang.ClassNotFoundException`