public static Type getCollectionType(Type type, JAXDoclet<?> doclet) { Type collectionType = Utils.findSuperType(type, "java.util.Collection"); // FIXME: this is dodgy at best if (collectionType != null) { ParameterizedType parameterizedType = type.asParameterizedType(); Type[] types = parameterizedType == null ? null : parameterizedType.typeArguments(); if (types != null && types.length == 1) return types[0]; return doclet.forName("java.lang.Object"); } return type; }
public static boolean isCollection(Type type) { Type collectionType = Utils.findSuperType(type, "java.util.Collection"); // FIXME: this is dodgy at best return collectionType != null; }