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 Object

Utility methods for classes.

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

Method Summary
static Class classForName(String className)
          Deprecated. since 4.3 - use Classes.getClassFactory().
static boolean isSubClass(Class<?> subClass, Class<?> parentClass)
          Deprecated. since 4.3, use parentClass.isAssignableFrom(subClass)
static Object newInstance(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 Class classForName(String className)
                          throws 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:
ClassNotFoundException - if the given class can't be loaded by both classloaders.

newInstance

public static Object newInstance(String className)
                          throws InstantiationException,
                                 IllegalAccessException,
                                 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:
InstantiationException - exception thrown by newInstance()
IllegalAccessException - exception thrown by newInstance()
ClassNotFoundException - if the given class can't be loaded by both classloaders

isSubClass

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

Checks if this class is a subclass.



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