Do you know about reflection? The classes in the java.lang.reflect package can be used to get information about an object.