langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java
changeset 1789 7ac8c0815000
parent 1264 076a3cde30d5
child 5520 86e4b9a9da40
equal deleted inserted replaced
1788:ced0a1a7ec80 1789:7ac8c0815000
   107     }
   107     }
   108 
   108 
   109     /**
   109     /**
   110      * {@inheritDoc}
   110      * {@inheritDoc}
   111      */
   111      */
   112     public void invokeMethod(String methodName, Class[] paramClasses,
   112     public void invokeMethod(String methodName, Class<?>[] paramClasses,
   113             Object[] params)
   113             Object[] params)
   114     throws Exception {
   114     throws Exception {
   115         if (DEBUG) {
   115         if (DEBUG) {
   116             configuration.root.printError("DEBUG: " + this.getClass().getName()
   116             configuration.root.printError("DEBUG: " + this.getClass().getName()
   117                 + "." + methodName);
   117                 + "." + methodName);
   142      * Build the constant summary.
   142      * Build the constant summary.
   143      *
   143      *
   144      * @param elements the list of elements describing constant summary
   144      * @param elements the list of elements describing constant summary
   145      *                 documentation.
   145      *                 documentation.
   146      */
   146      */
   147     public void buildConstantSummary(List elements) throws Exception {
   147     public void buildConstantSummary(List<?> elements) throws Exception {
   148         build(elements);
   148         build(elements);
   149         writer.close();
   149         writer.close();
   150     }
   150     }
   151 
   151 
   152     /**
   152     /**
   184      * Build the summary for each documented package.
   184      * Build the summary for each documented package.
   185      *
   185      *
   186      * @param elements the XML elements that represent the components
   186      * @param elements the XML elements that represent the components
   187      *                 of documentation for each package.
   187      *                 of documentation for each package.
   188      */
   188      */
   189     public void buildConstantSummaries(List elements) {
   189     public void buildConstantSummaries(List<?> elements) {
   190         PackageDoc[] packages = configuration.packages;
   190         PackageDoc[] packages = configuration.packages;
   191         printedPackageHeaders = new HashSet<String>();
   191         printedPackageHeaders = new HashSet<String>();
   192         for (int i = 0; i < packages.length; i++) {
   192         for (int i = 0; i < packages.length; i++) {
   193             if (hasConstantField(packages[i])) {
   193             if (hasConstantField(packages[i])) {
   194                 currentPackage = packages[i];
   194                 currentPackage = packages[i];
   202      * Build the summary for the current package.
   202      * Build the summary for the current package.
   203      *
   203      *
   204      * @param elements the list of XML elements that make up package
   204      * @param elements the list of XML elements that make up package
   205      *                 documentation.
   205      *                 documentation.
   206      */
   206      */
   207     public void buildPackageConstantSummary(List elements) {
   207     public void buildPackageConstantSummary(List<?> elements) {
   208         build(elements);
   208         build(elements);
   209     }
   209     }
   210 
   210 
   211     /**
   211     /**
   212      * Build the summary for the current class.
   212      * Build the summary for the current class.
   213      *
   213      *
   214      * @param elements the list of XML elements that make up the class
   214      * @param elements the list of XML elements that make up the class
   215      *                 constant summary.
   215      *                 constant summary.
   216      */
   216      */
   217     public void buildClassConstantSummary(List elements) {
   217     public void buildClassConstantSummary(List<?> elements) {
   218         ClassDoc[] classes = currentPackage.name().length() > 0 ?
   218         ClassDoc[] classes = currentPackage.name().length() > 0 ?
   219             currentPackage.allClasses() :
   219             currentPackage.allClasses() :
   220             configuration.classDocCatalog.allClasses(
   220             configuration.classDocCatalog.allClasses(
   221                 DocletConstants.DEFAULT_PACKAGE_NAME);
   221                 DocletConstants.DEFAULT_PACKAGE_NAME);
   222         Arrays.sort(classes);
   222         Arrays.sort(classes);
   295      * @return true if the given package has constant fields to document.
   295      * @return true if the given package has constant fields to document.
   296      */
   296      */
   297     private boolean hasConstantField (ClassDoc classDoc) {
   297     private boolean hasConstantField (ClassDoc classDoc) {
   298         VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc,
   298         VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc,
   299             VisibleMemberMap.FIELDS, configuration.nodeprecated);
   299             VisibleMemberMap.FIELDS, configuration.nodeprecated);
   300         List fields = visibleMemberMapFields.getLeafClassMembers(configuration);
   300         List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration);
   301         for (Iterator iter = fields.iterator(); iter.hasNext(); ) {
   301         for (Iterator<?> iter = fields.iterator(); iter.hasNext(); ) {
   302             FieldDoc field = (FieldDoc) iter.next();
   302             FieldDoc field = (FieldDoc) iter.next();
   303             if (field.constantValueExpression() != null) {
   303             if (field.constantValueExpression() != null) {
   304                 classDocsWithConstFields.add(classDoc);
   304                 classDocsWithConstFields.add(classDoc);
   305                 return true;
   305                 return true;
   306             }
   306             }