langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java
author briangoetz
Wed, 18 Dec 2013 16:05:18 -0500
changeset 22163 3651128c74eb
parent 22159 682da512ec17
child 25454 376a52c9540c
permissions -rw-r--r--
8030244: Update langtools to use Diamond Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 9606
diff changeset
     2
 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.internal.toolkit.util;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
    28
import java.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.javadoc.*;
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.Configuration;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * This class acts as an artificial PackageDoc for classes specified
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * on the command line when running Javadoc.  For example, if you
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * specify several classes from package java.lang, this class will catalog
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * those classes so that we can retrieve all of the classes from a particular
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * package later.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    39
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    40
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    41
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    42
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @since 1.4
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 public class ClassDocCatalog {
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
      * Stores the set of packages that the classes specified on the command line
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
      * belong to.  Note that the default package is "".
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    54
     private Set<String> packageSet;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
      * Stores all classes for each package
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    60
     private Map<String,Set<ClassDoc>> allClasses;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
      * Stores ordinary classes (excluding Exceptions and Errors) for each
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
      * package
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    66
     private Map<String,Set<ClassDoc>> ordinaryClasses;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
      * Stores exceptions for each package
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    71
     private Map<String,Set<ClassDoc>> exceptions;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
     * Stores enums for each package.
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    76
    private Map<String,Set<ClassDoc>> enums;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * Stores annotation types for each package.
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    81
    private Map<String,Set<ClassDoc>> annotationTypes;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
      * Stores errors for each package
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    86
     private Map<String,Set<ClassDoc>> errors;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
      * Stores interfaces for each package
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
      */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    91
     private Map<String,Set<ClassDoc>> interfaces;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
    93
     private Configuration configuration;
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
    94
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
      * Construct a new ClassDocCatalog.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
      *
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
      * @param classdocs the array of ClassDocs to catalog
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
      */
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   100
     public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
         init();
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   102
         this.configuration = config;
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14260
diff changeset
   103
         for (ClassDoc classdoc : classdocs) {
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14260
diff changeset
   104
             addClassDoc(classdoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
         }
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     }
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
      * Construct a new ClassDocCatalog.
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
      *
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
      */
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     public ClassDocCatalog () {
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
         init();
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     }
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     private void init() {
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   117
         allClasses = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   118
         ordinaryClasses = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   119
         exceptions = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   120
         enums = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   121
         annotationTypes = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   122
         errors = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   123
         interfaces = new HashMap<>();
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   124
         packageSet = new HashSet<>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     }
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
      * Add the given class to the catalog.
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
      * @param classdoc the ClassDoc to add to the catelog.
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
      */
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
      public void addClassDoc(ClassDoc classdoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        if (classdoc == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        addClass(classdoc, allClasses);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        if (classdoc.isOrdinaryClass()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
            addClass(classdoc, ordinaryClasses);
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        } else if (classdoc.isException()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            addClass(classdoc, exceptions);
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        } else if (classdoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            addClass(classdoc, enums);
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        } else if (classdoc.isAnnotationType()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
            addClass(classdoc, annotationTypes);
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        } else if (classdoc.isError()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
            addClass(classdoc, errors);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        } else if (classdoc.isInterface()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
            addClass(classdoc, interfaces);
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
       * Add the given class to the given map.
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
       * @param classdoc the ClassDoc to add to the catelog.
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
       * @param map the Map to add the ClassDoc to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
       */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   156
      private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
          PackageDoc pkg = classdoc.containingPackage();
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   159
          if (pkg.isIncluded() || (configuration.nodeprecated && Util.isDeprecated(pkg))) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   160
              //No need to catalog this class if it's package is
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   161
              //included on the command line or if -nodeprecated option is set
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   162
              // and the containing package is marked as deprecated.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
              return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
          }
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
          String key = Util.getPackageName(pkg);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   166
          Set<ClassDoc> s = map.get(key);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
          if (s == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
              packageSet.add(key);
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   169
              s = new HashSet<>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
          }
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
          s.add(classdoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
          map.put(key, s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   176
      private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   177
          Set<ClassDoc> s = m.get(key);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
          if (s == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
              return new ClassDoc[] {};
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
          } else {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   181
              return s.toArray(new ClassDoc[] {});
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
          }
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
       * Return all of the classes specified on the command-line that
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
       * belong to the given package.
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 9606
diff changeset
   188
       * @param pkgDoc the package to return the classes for.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
      public ClassDoc[] allClasses(PackageDoc pkgDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
          return pkgDoc.isIncluded() ?
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                pkgDoc.allClasses() :
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                getArray(allClasses, Util.getPackageName(pkgDoc));
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
       * Return all of the classes specified on the command-line that
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
       * belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
      public ClassDoc[] allClasses(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
          return getArray(allClasses, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
      * Return the array of package names that this catalog stores
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
      * ClassDocs for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
      */
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     public String[] packageNames() {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   211
         return packageSet.toArray(new String[] {});
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
     }
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
      * Return true if the given package is known to this catalog.
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
      * @param packageName the name to check.
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
      * @return true if this catalog has any information about
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
      * classes in the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
      */
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
     public boolean isKnownPackage(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
         return packageSet.contains(packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
     }
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
       * Return all of the errors specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
      public ClassDoc[] errors(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
          return getArray(errors, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
       * Return all of the exceptions specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
      public ClassDoc[] exceptions(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
          return getArray(exceptions, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
       * Return all of the enums specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
      public ClassDoc[] enums(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
          return getArray(enums, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
       * Return all of the annotation types specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
      public ClassDoc[] annotationTypes(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
          return getArray(annotationTypes, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
       * Return all of the interfaces specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
      public ClassDoc[] interfaces(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
          return getArray(interfaces, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
      /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
       * Return all of the ordinary classes specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
       * that belong to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
       * @param packageName the name of the package specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
       * command-line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
       */
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
      public ClassDoc[] ordinaryClasses(String packageName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
          return getArray(ordinaryClasses, packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
      }
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
}