jlibs.core.lang
Class ClassUtil

java.lang.Object
  extended by jlibs.core.lang.ClassUtil

public class ClassUtil
extends Object

Author:
Santhosh Kumar T

Constructor Summary
ClassUtil()
           
 
Method Summary
static Class box(Class clazz)
           
static Class getClassingClass()
           
static Class getClassingClass(int offset)
          returns the calling class.
static ClassLoader getClassingClassLoader()
           
static ClassLoader getClassLoader(Class clazz)
          Returns the classloader for the speficied clazz.
static String getClassPath(Class clazz)
          Returns the classpath resource(directory or jar) from which specified class is loaded.
static Class getPrimitiveType(String className)
           
static boolean isPrimitiveWrapper(Class clazz)
           
static Class unbox(Class clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtil

public ClassUtil()
Method Detail

getClassPath

public static String getClassPath(Class clazz)
Returns the classpath resource(directory or jar) from which specified class is loaded.

Parameters:
clazz - class
Returns:
resource from which the class is loaded

getClassLoader

public static ClassLoader getClassLoader(Class clazz)
Returns the classloader for the speficied clazz. Unlike Class.getClassLoader() this will never return null.


unbox

public static Class unbox(Class clazz)

isPrimitiveWrapper

public static boolean isPrimitiveWrapper(Class clazz)

box

public static Class box(Class clazz)

getPrimitiveType

public static Class getPrimitiveType(String className)

getClassingClass

public static Class getClassingClass(int offset)
returns the calling class. offset 0 returns class who is calling this method offset 1 returns class who called your method and so on


getClassingClass

public static Class getClassingClass()

getClassingClassLoader

public static ClassLoader getClassingClassLoader()


Copyright © 2018. All rights reserved.