How can I find out through reflection what is the string name of the method?
For example given:
class Car{ public void getFoo(){ } }
So, you want to get the name of the currently executing method? Here's a somewhat ugly way to do that:
Exception e = new Exception(); e.fillInStackTrace(); String methodName = e.getStackTrace()[0].getMethodName();