Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.util
Class ClassUtils

java.lang.Object
  extended byorg.evolvica.util.ClassUtils

public class ClassUtils
extends java.lang.Object

Utility methods for class handling.

Since:
0.4.0
Version:
$Revision: 1.7 $ $Date: 2004/05/26 11:58:35 $
Author:
Andreas Rummler

Method Summary
static java.lang.Class callingClass()
          Returns the caller of the the methods which calls this method.
static java.lang.Class callingClass(int offset)
          Returns the class with the given offset from the call stack.
static java.lang.String getShortClassname(java.lang.Class clazz)
          Returns the short classname of a class (without parent packages).
static boolean isInstantiable(java.lang.Class clazz)
          Checks if this class can be instantiated automatically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

callingClass

public static final java.lang.Class callingClass()
Returns the caller of the the methods which calls this method. This is a convinience method for ClassUtil.callingClass( 2 );

Returns:
caller of the method which calls this method

callingClass

public static final java.lang.Class callingClass(int offset)
Returns the class with the given offset from the call stack. An offset of 0 returns ClassUtils, 1 returns the caller of this method itself, 2 the caller of the calling method (and so on).

Parameters:
offset - offset of the class in the call stack
Returns:
class with the given offset from the call stack or null if the class cannot be found

getShortClassname

public static final java.lang.String getShortClassname(java.lang.Class clazz)
Returns the short classname of a class (without parent packages).

Parameters:
clazz - class
Returns:
short classname

isInstantiable

public static final boolean isInstantiable(java.lang.Class clazz)
Checks if this class can be instantiated automatically.

Parameters:
clazz - class to be checked
Returns:
true if an instance can be created, false instead

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems