org.mondemand.util
Class ClassUtils
java.lang.Objectorg.mondemand.util.ClassUtils
public class ClassUtils
extends java.lang.Object
Various class utilities that are used when the user doesn't specify parameters in the API.
These methods do not usually perform very well due to the need to obtain stack traces, so it is almost always
preferred for the user to specify these parameters in the MonDemand API instead of trying to determine
them using this class at runtime.
static String | getCallingClass(int depth)- Returns the calling class from the depth specified.
|
static int | getCallingLine(int depth)- Returns the calling line number from the depth specified.
|
static String | getMainClass()- Returns the top-level class name.
|
getCallingClass
public static String getCallingClass(int depth)
Returns the calling class from the depth specified.
depth - the depth to traverse in the stack
- the name of the calling class in the stack
getCallingLine
public static int getCallingLine(int depth)
Returns the calling line number from the depth specified.
depth - the depth to traverse in the stack
- the line number of the calling class in the stack
getMainClass
public static String getMainClass()
Returns the top-level class name. Useful when trying to determine the name of the application
calling the system when it is not specified.
- the name of the top-most class in the calling stack