コード例 #1
0
ファイル: Utils.java プロジェクト: orionhealth/jax-doclets
 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
ファイル: Utils.java プロジェクト: orionhealth/jax-doclets
 public static boolean isCollection(Type type) {
   Type collectionType = Utils.findSuperType(type, "java.util.Collection");
   // FIXME: this is dodgy at best
   return collectionType != null;
 }