org.licas.util.classloader

## Class JarClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - org.licas.util.classloader.JarClassLoader

-     public class JarClassLoader
      extends java.lang.ClassLoader

  This is a local jar file class loader that includes code re-compilation if the source exists. Based on 'Understanding the Java ClassLoader' by Greg Travis, IBM, 2001, and also http://kalanir.blogspot.co.uk/2010/01/how-to-write-custom-class-loader-to.html.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JarClassLoader(java.lang.String theFilePath)` Create a new instance of JarClassLoader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Class` | `findClass(java.lang.String className)` Find and return the class from the parsed jar file list.
    `java.util.ArrayList<java.lang.String>` | `getAllClasses(boolean rtnOnError)` Retrieve and return the names of all classes stored in the jar identified by the uri.
    `java.lang.String` | `getFilePath()` Get the local file path that the jar file was loaded from.
    `java.lang.Class` | `loadClass(java.lang.String className)` Get the class from the class loader.
    `java.lang.Class` | `loadClass(java.lang.String className, boolean resolve)` The heart of the ClassLoader -- automatically compile source as necessary when looking for class files

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

      `clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, 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

    - #### JarClassLoader

          public JarClassLoader(java.lang.String theFilePath)

      Create a new instance of JarClassLoader.
      Parameters:
        `theFilePath` - the full file path to the local jar file.

  - ### Method Detail

    - #### loadClass

          public java.lang.Class loadClass(java.lang.String className)
                                    throws java.lang.ClassNotFoundException

      Get the class from the class loader.
      Overrides:
        `loadClass` in class `java.lang.ClassLoader`
      Parameters:
        `className` - the full class name.
      Returns:
        the class object.
      Throws:
        `java.lang.ClassNotFoundException` - class not found.

    - #### loadClass

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

      The heart of the ClassLoader -- automatically compile source as necessary when looking for class files
      Overrides:
        `loadClass` in class `java.lang.ClassLoader`
      Parameters:
        `className` - the full class name.
        `resolve` - if true resolve the class, or prepare completely, not just lookup.
      Returns:
        the class object.
      Throws:
        `java.lang.ClassNotFoundException` - class not found.

    - #### findClass

          public java.lang.Class findClass(java.lang.String className)

      Find and return the class from the parsed jar file list.
      Overrides:
        `findClass` in class `java.lang.ClassLoader`
      Parameters:
        `className` - the full class name.
      Returns:
        the class object, or null if one does not exist.

    - #### getAllClasses

          public java.util.ArrayList<java.lang.String> getAllClasses(boolean rtnOnError)

      Retrieve and return the names of all classes stored in the jar identified by the uri. This does not add the jar as a permanent class loader. It only parses it to retrieve the class list. Use 'addLoader' or 'loadObject' to add as a permanent loader.
      Parameters:
        `rtnOnError` - if true, exit with the first load error, returning null. If false, try to load every class and ignore any errors.
      Returns:
        a list of all class names.

    - #### getFilePath

          public java.lang.String getFilePath()

      Get the local file path that the jar file was loaded from.
      Returns:
        the value of jarFile.