01: package tide.classsyntax;
02:
03: import java.lang.reflect.*;
04:
05: public final class RefClassUtils {
06: private RefClassUtils() {
07: }
08:
09: public static String simpleName(final Type t) {
10: if (t instanceof Class) {
11: return ((Class) t).getSimpleName();
12: } else if (t instanceof ParameterizedType) {
13: ParameterizedType pt = (ParameterizedType) t;
14: return simpleName(pt.getRawType());
15: } else {
16: //GenericArrayType, , TypeVariable<D>, WildcardType
17: System.out.println("ERR RCU: " + t);
18: }
19: return null;
20: }
21:
22: public static void main(String[] args) {
23:
24: }
25:
26: }
|