< prev index next >
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java
Print this page
rev 58344 : records implementation
*** 72,81 ****
--- 72,86 ----
* Stores enums for each package.
*/
private final Map<PackageElement, SortedSet<TypeElement>> enums;
/**
+ * Stores records for each package.
+ */
+ private final Map<PackageElement, SortedSet<TypeElement>> records;
+
+ /**
* Stores annotation types for each package.
*/
private final Map<PackageElement, SortedSet<TypeElement>> annotationTypes;
/**
*** 114,123 ****
--- 119,129 ----
comparator = utils.makeGeneralPurposeComparator();
allClasses = new HashMap<>();
ordinaryClasses = new HashMap<>();
exceptions = new HashMap<>();
enums = new HashMap<>();
+ records = new HashMap<>();
annotationTypes = new HashMap<>();
errors = new HashMap<>();
interfaces = new HashMap<>();
packageSet = new TreeSet<>(comparator);
}
*** 136,145 ****
--- 142,153 ----
addTypeElement(typeElement, ordinaryClasses);
} else if (utils.isException(typeElement)) {
addTypeElement(typeElement, exceptions);
} else if (utils.isEnum(typeElement)) {
addTypeElement(typeElement, enums);
+ } else if (utils.isRecord(typeElement)) {
+ addTypeElement(typeElement, records);
} else if (utils.isAnnotationType(typeElement)) {
addTypeElement(typeElement, annotationTypes);
} else if (utils.isError(typeElement)) {
addTypeElement(typeElement, errors);
} else if (utils.isInterface(typeElement)) {
*** 189,201 ****
? utils.getTypeElementsAsSortedSet(utils.getEnclosedTypeElements(packageElement))
: getSet(allClasses, packageElement);
}
/**
! * Return all of the classes specified on the command-line that belong to the given package.
! *
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> allUnnamedClasses() {
for (PackageElement pkg : allClasses.keySet()) {
if (pkg.isUnnamed()) {
return allClasses.get(pkg);
--- 197,207 ----
? utils.getTypeElementsAsSortedSet(utils.getEnclosedTypeElements(packageElement))
: getSet(allClasses, packageElement);
}
/**
! * Return all of the classes specified on the command-line that belong to the unnamed package.
*/
public SortedSet<TypeElement> allUnnamedClasses() {
for (PackageElement pkg : allClasses.keySet()) {
if (pkg.isUnnamed()) {
return allClasses.get(pkg);
*** 212,269 ****
}
/**
* Return all of the errors specified on the command-line that belong to the given package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> errors(PackageElement pkg) {
return getSet(errors, pkg);
}
/**
* Return all of the exceptions specified on the command-line that belong to the given package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> exceptions(PackageElement pkg) {
return getSet(exceptions, pkg);
}
/**
* Return all of the enums specified on the command-line that belong to the given package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> enums(PackageElement pkg) {
return getSet(enums, pkg);
}
/**
* Return all of the annotation types specified on the command-line that belong to the given
* package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> annotationTypes(PackageElement pkg) {
return getSet(annotationTypes, pkg);
}
/**
* Return all of the interfaces specified on the command-line that belong to the given package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> interfaces(PackageElement pkg) {
return getSet(interfaces, pkg);
}
/**
* Return all of the ordinary classes specified on the command-line that belong to the given
* package.
*
! * @param packageName the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> ordinaryClasses(PackageElement pkg) {
return getSet(ordinaryClasses, pkg);
}
}
--- 218,284 ----
}
/**
* Return all of the errors specified on the command-line that belong to the given package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> errors(PackageElement pkg) {
return getSet(errors, pkg);
}
/**
* Return all of the exceptions specified on the command-line that belong to the given package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> exceptions(PackageElement pkg) {
return getSet(exceptions, pkg);
}
/**
* Return all of the enums specified on the command-line that belong to the given package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> enums(PackageElement pkg) {
return getSet(enums, pkg);
}
/**
+ * Return all of the records specified on the command-line that belong to the given package.
+ *
+ * @param pkg the name of the package specified on the command-line.
+ */
+ public SortedSet<TypeElement> records(PackageElement pkg) {
+ return getSet(records, pkg);
+ }
+
+ /**
* Return all of the annotation types specified on the command-line that belong to the given
* package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> annotationTypes(PackageElement pkg) {
return getSet(annotationTypes, pkg);
}
/**
* Return all of the interfaces specified on the command-line that belong to the given package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> interfaces(PackageElement pkg) {
return getSet(interfaces, pkg);
}
/**
* Return all of the ordinary classes specified on the command-line that belong to the given
* package.
*
! * @param pkg the name of the package specified on the command-line.
*/
public SortedSet<TypeElement> ordinaryClasses(PackageElement pkg) {
return getSet(ordinaryClasses, pkg);
}
}
< prev index next >