public static String getCaller ( ) { StackTraceElement [ ] stes = new Exception ( ) . getStackTrace ( ) ; String caller ; if ( stes . length > 2 ) { StackTraceElement callerSte = stes [ 2 ] ; caller = callerSte . getClassName ( ) + "." + callerSte . getMethodName ( ) ; } else { caller = "<unknown>" ; } return caller ; }
Gets the calling method s name .