private static Class getClassOfType(Type type) { if (type instanceof Class) { return (Class) type; } else if (type instanceof GenericArrayType) { GenericArrayType arrayType = (GenericArrayType) type; Type t = arrayType.getGenericComponentType(); if (t instanceof Class) { return getArrayClass((Class) t); } } else if (type instanceof ParameterizedType) { ParameterizedType subType = (ParameterizedType) type; Type t = subType.getRawType(); if (t instanceof Class) { return (Class) t; } } return null; }
private static Class getClassOfType(Type type) { if (type instanceof Class) { return (Class) type; } else if (type instanceof GenericArrayType) { GenericArrayType arrayType = (GenericArrayType) type; Type t = arrayType.getGenericComponentType(); if (t instanceof Class) { return getArrayClass((Class) t); } } else if (type instanceof ParameterizedType) { ParameterizedType subType = (ParameterizedType) type; Type t = subType.getRawType(); if (t instanceof Class) { return (Class) t; } } return null; }
c = (Class) t; try { return new ClassTypePair(getArrayClass(c)); } catch (Exception e) { return new ClassTypePair(getArrayClass(c), t); } catch (Exception e) { return null;
c = (Class) t; try { return new ClassTypePair(getArrayClass(c)); } catch (Exception e) { return new ClassTypePair(getArrayClass(c), t); } catch (Exception e) { return null;