gausssoft.lang
Class ClassResolver

java.lang.Object
  |
  +--gausssoft.lang.ClassResolver

public class ClassResolver
extends Object

This class provides access to the Class.forName methods, except that a ClassNotFoundException is never thrown, but instead a ClassNotFoundException will be wrapped in a WrappedRuntimeException before being thrown.

Author:
Allan Crooks
See Also:
Class, Class.forName(String), Class.forName(String, boolean, ClassLoader), ClassNotFoundException

Method Summary
static Class get(String name)
          Executes Class.forName(String), but instead of throwing a ClassNotFoundException, it will throw a WrappedRuntimeException containing a ClassNotFoundException contained within it.
static Class get(String name, boolean initialize, ClassLoader loader)
          Executes Class.forName(String, boolean, ClassLoader), but instead of throwing a ClassNotFoundException, it will throw a WrappedRuntimeException, containing a ClassNotFoundException contained within it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static Class get(String name)
Executes Class.forName(String), but instead of throwing a ClassNotFoundException, it will throw a WrappedRuntimeException containing a ClassNotFoundException contained within it.
Parameters:
name - fully qualified name of the desired class
Returns:
class object representing the desired class
Throws:
LinkageError - if the linkage fails
ExceptionInInitializerError - if the initialization provoked by this method fails
WrappingRuntimeException - if the class cannot be located
See Also:
get(String, boolean, ClassLoader), Class.forName(String), ClassNotFoundException, WrappedRuntimeException

get

public static Class get(String name,
                        boolean initialize,
                        ClassLoader loader)
Executes Class.forName(String, boolean, ClassLoader), but instead of throwing a ClassNotFoundException, it will throw a WrappedRuntimeException, containing a ClassNotFoundException contained within it.
Parameters:
name - fully qualified name of the desired class
initialize - whether the class must be initialized
loader - class loader from which the class must be loaded
Returns:
class object representing the desired class
Throws:
LinkageError - if the linkage fails
ExceptionInInitializerError - if the initialization provoked by this method fails
WrappingRuntimeException - if the class cannot be located
See Also:
get(String), Class.forName(String, boolean, ClassLoader), ClassNotFoundException, WrappedRuntimeException