< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -72,10 +72,15 @@
      * 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,10 +119,11 @@
         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,10 +142,12 @@
             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,13 +197,11 @@
                 ? 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.
+     * 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,58 +218,67 @@
     }
 
     /**
      * 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.
+     * @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 packageName the name of the package specified on the command-line.
+     * @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 packageName the name of the package specified on the command-line.
+     * @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 packageName the name of the package specified on the command-line.
+     * @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 packageName the name of the package specified on the command-line.
+     * @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 packageName the name of the package specified on the command-line.
+     * @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 >