src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java
changeset 49879 601277b1d582
parent 47216 71c04702a3d5
child 54060 53a95878619f
equal deleted inserted replaced
49878:2422d4e027b0 49879:601277b1d582
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    35 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
    35 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
    36 import jdk.javadoc.internal.doclets.toolkit.Content;
    36 import jdk.javadoc.internal.doclets.toolkit.Content;
    37 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    37 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    38 import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
    38 import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
    39 import jdk.javadoc.internal.doclets.toolkit.util.DocFinder;
    39 import jdk.javadoc.internal.doclets.toolkit.util.DocFinder;
    40 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    40 
    41 
    41 import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
    42 
    42 
    43 /**
    43 /**
    44  * Builds documentation for a method.
    44  * Builds documentation for a method.
    45  *
    45  *
    46  *  <p><b>This is NOT part of any supported API.
    46  *  <p><b>This is NOT part of any supported API.
    58      * in time.
    58      * in time.
    59      */
    59      */
    60     private ExecutableElement currentMethod;
    60     private ExecutableElement currentMethod;
    61 
    61 
    62     /**
    62     /**
    63      * The class whose methods are being documented.
       
    64      */
       
    65     private final TypeElement typeElement;
       
    66 
       
    67     /**
       
    68      * The visible methods for the given class.
       
    69      */
       
    70     private final VisibleMemberMap visibleMemberMap;
       
    71 
       
    72     /**
       
    73      * The writer to output the method documentation.
    63      * The writer to output the method documentation.
    74      */
    64      */
    75     private final MethodWriter writer;
    65     private final MethodWriter writer;
    76 
    66 
    77     /**
    67     /**
    78      * The methods being documented.
    68      * The methods being documented.
    79      */
    69      */
    80     private final List<Element> methods;
    70     private final List<? extends Element> methods;
    81 
    71 
    82 
    72 
    83     /**
    73     /**
    84      * Construct a new MethodBuilder.
    74      * Construct a new MethodBuilder.
    85      *
    75      *
    88      * @param writer the doclet specific writer.
    78      * @param writer the doclet specific writer.
    89      */
    79      */
    90     private MethodBuilder(Context context,
    80     private MethodBuilder(Context context,
    91             TypeElement typeElement,
    81             TypeElement typeElement,
    92             MethodWriter writer) {
    82             MethodWriter writer) {
    93         super(context);
    83         super(context, typeElement);
    94         this.typeElement = typeElement;
       
    95         this.writer = writer;
    84         this.writer = writer;
    96         visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
    85         methods = getVisibleMembers(METHODS);
    97                 VisibleMemberMap.Kind.METHODS);
       
    98         methods = visibleMemberMap.getLeafMembers();
       
    99     }
    86     }
   100 
    87 
   101     /**
    88     /**
   102      * Construct a new MethodBuilder.
    89      * Construct a new MethodBuilder.
   103      *
    90      *