Let\'s say I have a base class named Entity. In that class, I have a static method to retrieve the class name:
Entity
class Entity { public static
My context: superclass Entity with subclasses for XML objects. My solution: Create a class variable in the superclass
Class> claz;
Then in the subclass I would set the variable of the superclass in the constructor
public class SubClass { public SubClass() { claz = this.getClass(); } }