In java.lang.reflect
, one would do:
Field someField = ...;
Class<?> fieldType = someField.getType();
But what do I do with javax.lang.model
's VariableElement
(which may or may not represent a field)? A corresponding return value would be (I guess) TypeElement
.
VariableElement someField = ...;
TypeElement fieldType = someField.???;
So, in javax.lang.model
, how do I get the type (or TypeElement
) of a field, represented by VariableElement
?
BTW, there is not a single Stackoverflow-tag which would fit to javax.lang.model ;)