示例#1
0
 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;
 }
示例#2
0
 public static boolean isCollection(Type type) {
   Type collectionType = Utils.findSuperType(type, "java.util.Collection");
   // FIXME: this is dodgy at best
   return collectionType != null;
 }