org.apache.commons.discovery.tools
Class ClassUtils

java.lang.Object
  |
  +--org.apache.commons.discovery.tools.ClassUtils

public class ClassUtils
extends java.lang.Object

Author:
Richard A. Sitze

Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.reflect.Method findPublicStaticMethod(java.lang.Class clazz, java.lang.Class returnType, java.lang.String methodName, java.lang.Class[] paramTypes)
           
static java.lang.String getPackageName(java.lang.Class clazz)
          Get package name.
static void setLog(org.apache.commons.logging.Log _log)
           
 
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

setLog

public static void setLog(org.apache.commons.logging.Log _log)

getPackageName

public static java.lang.String getPackageName(java.lang.Class clazz)
Get package name. Not all class loaders 'keep' package information, in which case Class.getPackage() returns null. This means that calling Class.getPackage().getName() is unreliable at best.

findPublicStaticMethod

public static java.lang.reflect.Method findPublicStaticMethod(java.lang.Class clazz,
                                                              java.lang.Class returnType,
                                                              java.lang.String methodName,
                                                              java.lang.Class[] paramTypes)
Returns:
Method 'public static returnType methodName(paramTypes)', if found to be directly implemented by clazz.


Copyright (c) 2002 - Apache Software Foundation