If I was programming in Java I guess I want Java to return the string: "JLabel" probably combined with the URI of the source were JLabel is defined.
In that case, you would have to work with the reflection features of Java. In BaseX, the equivalent facility is (as you already guessed) the Inspection Module.
However, I wouldn't recommend you to follow this path, as you would soon end up doing all kinds of things with string comparisons. What are you actually trying to attain with the string representation of types?