Top Description Constructors Methods
org.eclipse.jetty.util

public Class Loader

extends Object
Class Inheritance
Imports
java.net.URL, java.util.Locale, .MissingResourceException, .ResourceBundle

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static URL
public static ResourceBundle
getResourceBundle(String name, boolean checkParents, Locale locale)

public static Class<T>

Returns:

Class
loadClass
(String
the name of the new class to load
name
)

Load a class.

public static Class<T>

Returns:

Class
loadClass
(Class<T>
a similar class, belong in the same classloader of the desired class to load
loaderClass
,
String
the name of the new class to load
name
)

Load a class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Loaderback to summary
public Loader()

Method Detail

getResourceback to summary
public static URL getResource(String name)
getResourceBundleback to summary
public static ResourceBundle getResourceBundle(String name, boolean checkParents, Locale locale) throws MissingResourceException
loadClassback to summary
public static Class<T> loadClass(String name) throws ClassNotFoundException

Load a class.

Load a class either from the thread context classloader or if none, the system loader

Parameters
name:String

the name of the new class to load

Returns:Class<T>

Class

Annotations
@SuppressWarnings:rawtypes
Exceptions
ClassNotFoundException:
if not able to find the class
loadClassback to summary
public static Class<T> loadClass(Class<T> loaderClass, String name) throws ClassNotFoundException

Load a class. Load a class from the same classloader as the passed loadClass, or if none then use loadClass(String)

Parameters
loaderClass:Class<T>

a similar class, belong in the same classloader of the desired class to load

name:String

the name of the new class to load

Returns:Class<T>

Class

Annotations
@SuppressWarnings:rawtypes
Exceptions
ClassNotFoundException:
if not able to find the class