org.eclipse.jetty.util

## Class Loader

- java.lang.Object
- - org.eclipse.jetty.util.Loader

-     public class Loader
      extends java.lang.Object

  ClassLoader Helper. This helper class allows classes to be loaded either from the Thread's ContextClassLoader, the classloader of the derived class or the system ClassLoader. Usage:

       public class MyClass {
           void myMethod() {
                ...
                Class c=Loader.loadClass(this.getClass(),classname);
                ...
           }

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Loader()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getClassPath(java.lang.ClassLoader loader)` Generate the classpath (as a string) of all classloaders above the given classloader.
    `static java.net.URL` | `getResource(java.lang.Class<?> loadClass, java.lang.String name, boolean checkParents)`
    `static java.util.ResourceBundle` | `getResourceBundle(java.lang.Class<?> loadClass, java.lang.String name, boolean checkParents, java.util.Locale locale)`
    `static java.lang.Class` | `loadClass(java.lang.Class loadClass, java.lang.String name)`
    `static java.lang.Class` | `loadClass(java.lang.Class loadClass, java.lang.String name, boolean checkParents)` Load a class.

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

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

- - ### Constructor Detail

    - #### Loader

          public Loader()

  - ### Method Detail

    - #### getResource

          public static java.net.URL getResource(java.lang.Class<?> loadClass,
                                 java.lang.String name,
                                 boolean checkParents)
                                          throws java.lang.ClassNotFoundException

      Throws:
        `java.lang.ClassNotFoundException`

    - #### loadClass

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

      Throws:
        `java.lang.ClassNotFoundException`

    - #### loadClass

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

      Load a class.
      Parameters:
        `loadClass` -
        `name` -
        `checkParents` - If true, try loading directly from parent classloaders.
      Returns:
        Class
      Throws:
        `java.lang.ClassNotFoundException`

    - #### getResourceBundle

          public static java.util.ResourceBundle getResourceBundle(java.lang.Class<?> loadClass,
                                                   java.lang.String name,
                                                   boolean checkParents,
                                                   java.util.Locale locale)
                                                            throws java.util.MissingResourceException

      Throws:
        `java.util.MissingResourceException`

    - #### getClassPath

          public static java.lang.String getClassPath(java.lang.ClassLoader loader)
                                               throws java.lang.Exception

      Generate the classpath (as a string) of all classloaders above the given classloader. This is primarily used for jasper.
      Returns:
        the system class path
      Throws:
        `java.lang.Exception`

Copyright © 2013 FuseSource, Corp.. All Rights Reserved.