code: protected void buildIndexMap(DocletEnvironment docEnv)  {
          Set<PackageElement> packages = configuration.getSpecifiedPackageElements();
          Set<TypeElement> classes = configuration.getIncludedTypeElements();
          if (!classesOnly) {
              if (packages.isEmpty()) {
                  Set<PackageElement> set = new HashSet<>();
                  for (TypeElement aClass : classes) {
                      PackageElement pkg = utils.containingPackage(aClass);
                      if (pkg != null && !pkg.isUnnamed()) {
                          set.add(pkg);
                      }
                  }
                  adjustIndexMap(set);
              } else {
                  adjustIndexMap(packages);
              }
          }
          adjustIndexMap(classes);
          if (!classesOnly) {
              for (TypeElement aClass : classes) {
                  if (shouldAddToIndexMap(aClass)) {
                      putMembersInIndexMap(aClass);
                  }
              }
              if (configuration.showModules) {
                  addModulesToIndexMap();
              }
          }
      }
docs: Get all the members in all the Packages and all the Classes
  given on the command line. Form separate list of those members depending
  upon their names.
  
  @param docEnv the doclet environment