org.apache.velocity.tools
Class ClassUtils

java.lang.Object
  extended by org.apache.velocity.tools.ClassUtils

public class ClassUtils
extends java.lang.Object

Repository for common class and reflection methods.

Version:
$Id: ClassUtils.java 511959 2007-02-26 19:24:39Z nbubna $
Author:
Nathan Bubna

Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.reflect.Method findDeclaredMethod(java.lang.Class clazz, java.lang.String name, java.lang.Class[] params)
           
static java.lang.reflect.Method findMethod(java.lang.Class clazz, java.lang.String name, java.lang.Class[] params)
           
static java.lang.Class getClass(java.lang.String name)
          Return the Class object for the specified fully qualified class name, from this thread's current class loader.
static java.lang.Object getInstance(java.lang.String classname)
           
 
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

getClass

public static java.lang.Class getClass(java.lang.String name)
                                throws java.lang.ClassNotFoundException
Return the Class object for the specified fully qualified class name, from this thread's current class loader. If no class loader is set for the current thread, then the class loader that loaded this class will be used.

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

getInstance

public static java.lang.Object getInstance(java.lang.String classname)
                                    throws java.lang.ClassNotFoundException,
                                           java.lang.IllegalAccessException,
                                           java.lang.InstantiationException
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

findMethod

public static java.lang.reflect.Method findMethod(java.lang.Class clazz,
                                                  java.lang.String name,
                                                  java.lang.Class[] params)
                                           throws java.lang.SecurityException
Throws:
java.lang.SecurityException

findDeclaredMethod

public static java.lang.reflect.Method findDeclaredMethod(java.lang.Class clazz,
                                                          java.lang.String name,
                                                          java.lang.Class[] params)
                                                   throws java.lang.SecurityException
Throws:
java.lang.SecurityException


Copyright (c) 2003-2007 Apache Software Foundation