org.eclipse.jetty.util
类 Loader

java.lang.Object
  继承者 org.eclipse.jetty.util.Loader

public class Loader
extends 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);
          ...
     }
 


构造方法摘要
Loader()
           
 
方法摘要
static String getClassPath(ClassLoader loader)
          Generate the classpath (as a string) of all classloaders above the given classloader.
static URL getResource(Class<?> loadClass, String name, boolean checkParents)
           
static ResourceBundle getResourceBundle(Class<?> loadClass, String name, boolean checkParents, Locale locale)
           
static Class loadClass(Class loadClass, String name)
           
static Class loadClass(Class loadClass, String name, boolean checkParents)
          Load a class.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Loader

public Loader()
方法详细信息

getResource

public static URL getResource(Class<?> loadClass,
                              String name,
                              boolean checkParents)

loadClass

public static Class loadClass(Class loadClass,
                              String name)
                       throws ClassNotFoundException
抛出:
ClassNotFoundException

loadClass

public static Class loadClass(Class loadClass,
                              String name,
                              boolean checkParents)
                       throws ClassNotFoundException
Load a class.

参数:
loadClass -
name -
checkParents - If true, try loading directly from parent classloaders.
返回:
Class
抛出:
ClassNotFoundException

getResourceBundle

public static ResourceBundle getResourceBundle(Class<?> loadClass,
                                               String name,
                                               boolean checkParents,
                                               Locale locale)
                                        throws MissingResourceException
抛出:
MissingResourceException

getClassPath

public static String getClassPath(ClassLoader loader)
                           throws Exception
Generate the classpath (as a string) of all classloaders above the given classloader. This is primarily used for jasper.

返回:
the system class path
抛出:
Exception


Copyright © 2013. All Rights Reserved.