fc.util
Class ClassUtil

java.lang.Object
  extended by fc.util.ClassUtil

public class ClassUtil
extends Object


Constructor Summary
ClassUtil()
           
 
Method Summary
static String getClassLoaderInfo(Class c)
          Returns classloader information about the specified class.
static String getClassLoaderInfo(Object obj)
          Returns classloader information about the specified object
static String getClassName()
          This method can be called from a static method and returns the class name in which the calling static method was declared.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtil

public ClassUtil()
Method Detail

getClassLoaderInfo

public static String getClassLoaderInfo(Object obj)
Returns classloader information about the specified object


getClassLoaderInfo

public static String getClassLoaderInfo(Class c)
Returns classloader information about the specified class.


getClassName

public static String getClassName()
This method can be called from a static method and returns the class name in which the calling static method was declared.

Important note: The returned class name is the name where the static method was declared, NOT the runtime class since static methods are not virtual. For example:


Class A 
        { 
        static void foo(...) {
                System.out.print(ClassUtil.getClassName());
                }
        }

public class B extends A
        {
        }

% java B  
will print A  [NOT B]


main

public static void main(String[] args)