org.apache.ws.jaxme.util
Class ClassLoader

java.lang.Object
  extended by org.apache.ws.jaxme.util.ClassLoader

public class ClassLoader
extends java.lang.Object

Helper class for working with class loaders.

Version:
$Id$
Author:
Jochen Wiedmann

Constructor Summary
ClassLoader()
           
 
Method Summary
static java.lang.Class getClass(java.lang.String pName)
          Loads a class with the given name.
static java.lang.Class getClass(java.lang.String pName, java.lang.Class pAssignableTo)
          Loads a class with the given name using getClass(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoader

public ClassLoader()
Method Detail

getClass

public static java.lang.Class getClass(java.lang.String pName)
                                throws java.lang.ClassNotFoundException

Loads a class with the given name. First attempts to use the context class loader, then its own class loader.

Parameters:
pName - The fully qualified name of the class being loaded.
Returns:
The class with the name pName.
Throws:
java.lang.ClassNotFoundException - Loading the class failed.

getClass

public static java.lang.Class getClass(java.lang.String pName,
                                       java.lang.Class pAssignableTo)
                                throws java.lang.ClassNotFoundException

Loads a class with the given name using getClass(String). If an instance of the returned class cannot be assigned to the class or interface pAssignableTo, throws an IllegalArgumentException.

Throws:
java.lang.ClassNotFoundException - The class with the name pName could not be loaded.
java.lang.IllegalArgumentException - Instances of the class with the name pName are not assignable to the interface or class pAssignableTo.