Hello everybody. Is it possible to get information about class that invoking the other one?
class Bar{
public Bar{}
public String getInvokingClassInfo(){
return "...";
}
}
class Foo{
public Foo(){
Bar bar = new Bar();
System.out.println("Invoking class is: "+bar.getInvokingClassInfo());
}
}
How to get in the place:
System.out.println(bar.getInvokingClassInfo());
info about class that invoking (Foo) this one (Bar):
Invoking class: Foo