com.ideo.sweetdevria.util
Class ClassUtils

java.lang.Object
  extended by com.ideo.sweetdevria.util.ClassUtils

public class ClassUtils
extends java.lang.Object


Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.Class applicationClass(java.lang.String className)
          Return the Class object for the specified fully qualified class name, from this web application's class loader.
static java.lang.Object applicationInstance(java.lang.String className)
          Return a new instance of the specified fully qualified class name, after loading the class from this web application's class loader.
static java.lang.ClassLoader getClassLoader()
          Return the current class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

applicationInstance

public static java.lang.Object applicationInstance(java.lang.String className)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.IllegalAccessException,
                                                   java.lang.InstantiationException
Return a new instance of the specified fully qualified class name, after loading the class from this web application's class loader. The specified class MUST have a public zero-arguments constructor.

Parameters:
className - Fully qualified class name to use
Returns:
new instance of class
Throws:
java.lang.ClassNotFoundException - if the class cannot be found
java.lang.IllegalAccessException - if the class or its constructor is not accessible
java.lang.InstantiationException - if this class represents an abstract class, an interface, an array class, a primitive type, or void
java.lang.InstantiationException - if this class has no zero-arguments constructor

applicationClass

public static java.lang.Class applicationClass(java.lang.String className)
                                        throws java.lang.ClassNotFoundException
Return the Class object for the specified fully qualified class name, from this web application's class loader.

Parameters:
className - Fully qualified class name to be loaded
Returns:
Class object
Throws:
java.lang.ClassNotFoundException - if the class cannot be found

getClassLoader

public static java.lang.ClassLoader getClassLoader()
Return the current class loader.

Returns:


Copyright © 2010 Ideo Technologies. All Rights Reserved.