langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java
equal
deleted
inserted
replaced
74 * @return List List of eligible members for whom |
74 * @return List List of eligible members for whom |
75 * documentation is getting generated. |
75 * documentation is getting generated. |
76 */ |
76 */ |
77 public static List<ProgramElementDoc> excludeDeprecatedMembersAsList( |
77 public static List<ProgramElementDoc> excludeDeprecatedMembersAsList( |
78 ProgramElementDoc[] members) { |
78 ProgramElementDoc[] members) { |
79 List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>(); |
79 List<ProgramElementDoc> list = new ArrayList<>(); |
80 for (ProgramElementDoc member : members) { |
80 for (ProgramElementDoc member : members) { |
81 if (member.tags("deprecated").length == 0) { |
81 if (member.tags("deprecated").length == 0) { |
82 list.add(member); |
82 list.add(member); |
83 } |
83 } |
84 } |
84 } |
271 * @param sort if true, return list of interfaces sorted alphabetically. |
271 * @param sort if true, return list of interfaces sorted alphabetically. |
272 * @return List of all the required interfaces. |
272 * @return List of all the required interfaces. |
273 */ |
273 */ |
274 public static List<Type> getAllInterfaces(Type type, |
274 public static List<Type> getAllInterfaces(Type type, |
275 Configuration configuration, boolean sort) { |
275 Configuration configuration, boolean sort) { |
276 Map<ClassDoc,Type> results = sort ? new TreeMap<ClassDoc,Type>() : new LinkedHashMap<ClassDoc,Type>(); |
276 Map<ClassDoc,Type> results = sort ? new TreeMap<>() : new LinkedHashMap<>(); |
277 Type[] interfaceTypes = null; |
277 Type[] interfaceTypes = null; |
278 Type superType = null; |
278 Type superType = null; |
279 if (type instanceof ParameterizedType) { |
279 if (type instanceof ParameterizedType) { |
280 interfaceTypes = ((ParameterizedType) type).interfaceTypes(); |
280 interfaceTypes = ((ParameterizedType) type).interfaceTypes(); |
281 superType = ((ParameterizedType) type).superclassType(); |
281 superType = ((ParameterizedType) type).superclassType(); |
298 for (Type t : getAllInterfaces(interfaceType, configuration, sort)) { |
298 for (Type t : getAllInterfaces(interfaceType, configuration, sort)) { |
299 results.put(t.asClassDoc(), t); |
299 results.put(t.asClassDoc(), t); |
300 } |
300 } |
301 } |
301 } |
302 if (superType == null) |
302 if (superType == null) |
303 return new ArrayList<Type>(results.values()); |
303 return new ArrayList<>(results.values()); |
304 //Try walking the tree. |
304 //Try walking the tree. |
305 addAllInterfaceTypes(results, |
305 addAllInterfaceTypes(results, |
306 superType, |
306 superType, |
307 interfaceTypesOf(superType), |
307 interfaceTypesOf(superType), |
308 false, configuration); |
308 false, configuration); |
309 List<Type> resultsList = new ArrayList<Type>(results.values()); |
309 List<Type> resultsList = new ArrayList<>(results.values()); |
310 if (sort) { |
310 if (sort) { |
311 Collections.sort(resultsList, new TypeComparator()); |
311 Collections.sort(resultsList, new TypeComparator()); |
312 } |
312 } |
313 return resultsList; |
313 return resultsList; |
314 } |
314 } |
742 public static ClassDoc[] filterOutPrivateClasses(final ClassDoc[] classes, |
742 public static ClassDoc[] filterOutPrivateClasses(final ClassDoc[] classes, |
743 boolean javafx) { |
743 boolean javafx) { |
744 if (!javafx) { |
744 if (!javafx) { |
745 return classes; |
745 return classes; |
746 } |
746 } |
747 final List<ClassDoc> filteredOutClasses = |
747 final List<ClassDoc> filteredOutClasses = new ArrayList<>(classes.length); |
748 new ArrayList<ClassDoc>(classes.length); |
|
749 for (ClassDoc classDoc : classes) { |
748 for (ClassDoc classDoc : classes) { |
750 if (classDoc.isPrivate() || classDoc.isPackagePrivate()) { |
749 if (classDoc.isPrivate() || classDoc.isPackagePrivate()) { |
751 continue; |
750 continue; |
752 } |
751 } |
753 Tag[] aspTags = classDoc.tags("treatAsPrivate"); |
752 Tag[] aspTags = classDoc.tags("treatAsPrivate"); |