info.magnolia.cms.util
Class ClassUtil

java.lang.Object
  extended by info.magnolia.cms.util.ClassUtil

Deprecated. since 4.3 - see specific methods for replacements.

public final class ClassUtil
extends java.lang.Object

Utility methods for classes.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Fabrizio Giustina

Method Summary
static java.lang.Class classForName(java.lang.String className)
          Deprecated. since 4.3 - use Classes.getClassFactory().
static boolean isSubClass(java.lang.Class<?> subClass, java.lang.Class<?> parentClass)
          Deprecated. since 4.3, use parentClass.isAssignableFrom(subClass)
static java.lang.Object newInstance(java.lang.String className)
          Deprecated. since 4.3 - use Classes.getClassFactory(). Shortcut for ClassUtil.classForName(className).newInstance()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

classForName

public static java.lang.Class classForName(java.lang.String className)
                                    throws java.lang.ClassNotFoundException
Deprecated. since 4.3 - use Classes.getClassFactory().

Load a class trying both with the standard that with the thread classloader.

Parameters:
className - class name
Returns:
loaded class
Throws:
java.lang.ClassNotFoundException - if the given class can't be loaded by both classloaders.

newInstance

public static java.lang.Object newInstance(java.lang.String className)
                                    throws java.lang.InstantiationException,
                                           java.lang.IllegalAccessException,
                                           java.lang.ClassNotFoundException
Deprecated. since 4.3 - use Classes.getClassFactory(). Shortcut for ClassUtil.classForName(className).newInstance()

Parameters:
className - class name
Returns:
instance of the given class
Throws:
java.lang.InstantiationException - exception thrown by newInstance()
java.lang.IllegalAccessException - exception thrown by newInstance()
java.lang.ClassNotFoundException - if the given class can't be loaded by both classloaders

isSubClass

public static boolean isSubClass(java.lang.Class<?> subClass,
                                 java.lang.Class<?> parentClass)
Deprecated. since 4.3, use parentClass.isAssignableFrom(subClass)

Checks if this class is a subclass.



Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.