org.xulux.utils
Class ClassLoaderUtils

java.lang.Object
  extended by org.xulux.utils.ClassLoaderUtils

public class ClassLoaderUtils
extends java.lang.Object

This util class contains classloader utils so we can do actual code reuse.

Version:
$Id: ClassLoaderUtils.java,v 1.1 2005/12/18 12:58:15 mvdb Exp $
Author:
Martin van den Bemt

Constructor Summary
protected ClassLoaderUtils()
          Make it possible to extend..
 
Method Summary
static java.lang.Class getClass(java.lang.String clazzString)
           
static java.lang.Object getObjectFromClass(java.lang.Class clazz)
          Also instantiates static AND non static innerclasses.
static java.lang.Object getObjectFromClass(java.lang.Class clazz, java.util.List parms)
          Tries to find a constructor with the parameters specified in the list If it cannot it will return the empty constructor.
static java.lang.Object getObjectFromClassString(java.lang.String classString)
           
protected static java.lang.Object getParentObjectForInnerClass(java.lang.Class clazz)
          Instantiates the parent object of an inner class.
static boolean isInner(java.lang.Class clazz)
           
static void setLogger(org.xulux.api.logging.ILogger logger)
          Set the logger to be used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderUtils

protected ClassLoaderUtils()
Make it possible to extend..

Method Detail

setLogger

public static void setLogger(org.xulux.api.logging.ILogger logger)
Set the logger to be used

Parameters:
logger - the logger

getObjectFromClassString

public static java.lang.Object getObjectFromClassString(java.lang.String classString)
Parameters:
classString - the class
Returns:
an object from the specified classString or null when errors occur

getObjectFromClass

public static java.lang.Object getObjectFromClass(java.lang.Class clazz)
Also instantiates static AND non static innerclasses. The parent class needs to have an empty constructor! You can overcome this problem by adding this to the paramlist!

Parameters:
clazz - the class
Returns:
an object from the specified class or null when errors occur

getParentObjectForInnerClass

protected static java.lang.Object getParentObjectForInnerClass(java.lang.Class clazz)
Instantiates the parent object of an inner class.

Parameters:
clazz - the class
Returns:
the instance of the inner class

isInner

public static boolean isInner(java.lang.Class clazz)
Parameters:
clazz - the class
Returns:
if the class is an inner class

getObjectFromClass

public static java.lang.Object getObjectFromClass(java.lang.Class clazz,
                                                  java.util.List parms)
Tries to find a constructor with the parameters specified in the list If it cannot it will return the empty constructor.

Parameters:
clazz - the class
parms - the list of parameters as classes
Returns:
the instantiated object

getClass

public static java.lang.Class getClass(java.lang.String clazzString)
Parameters:
clazzString - the class
Returns:
the clazz created from the specified String or null when it could not be created


Copyright © 2002-2007 Martin van den Bemt. All Rights Reserved.