15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.toolkit.builders;
27
28 import java.util.*;
29
30 import javax.lang.model.element.Element;
31 import javax.lang.model.element.ExecutableElement;
32 import javax.lang.model.element.TypeElement;
33 import javax.lang.model.type.TypeMirror;
34
35 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
36 import jdk.javadoc.internal.doclets.toolkit.Content;
37 import jdk.javadoc.internal.doclets.toolkit.DocletException;
38 import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
39 import jdk.javadoc.internal.doclets.toolkit.util.DocFinder;
40
41 import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
42
43 /**
44 * Builds documentation for a method.
45 *
46 * <p><b>This is NOT part of any supported API.
47 * If you write code that depends on this, you do so at your own risk.
48 * This code and its internal interfaces are subject to change or
49 * deletion without notice.</b>
50 */
51 public class MethodBuilder extends AbstractMemberBuilder {
52
53 /**
54 * The index of the current field that is being documented at this point
55 * in time.
144 /**
145 * Build the signature.
146 *
147 * @param methodDocTree the content tree to which the documentation will be added
148 */
149 protected void buildSignature(Content methodDocTree) {
150 methodDocTree.add(writer.getSignature(currentMethod));
151 }
152
153 /**
154 * Build the deprecation information.
155 *
156 * @param methodDocTree the content tree to which the documentation will be added
157 */
158 protected void buildDeprecationInfo(Content methodDocTree) {
159 writer.addDeprecated(currentMethod, methodDocTree);
160 }
161
162 /**
163 * Build the comments for the method. Do nothing if
164 * {@link BaseConfiguration#nocomment} is set to true.
165 *
166 * @param methodDocTree the content tree to which the documentation will be added
167 */
168 protected void buildMethodComments(Content methodDocTree) {
169 if (!configuration.nocomment) {
170 ExecutableElement method = currentMethod;
171 if (utils.getFullBody(currentMethod).isEmpty()) {
172 DocFinder.Output docs = DocFinder.search(configuration,
173 new DocFinder.Input(utils, currentMethod));
174 if (docs.inlineTags != null && !docs.inlineTags.isEmpty())
175 method = (ExecutableElement)docs.holder;
176 }
177 TypeMirror containingType = method.getEnclosingElement().asType();
178 writer.addComments(containingType, method, methodDocTree);
179 }
180 }
181
182 /**
183 * Build the tag information.
184 *
185 * @param methodDocTree the content tree to which the documentation will be added
186 */
187 protected void buildTagInfo(Content methodDocTree) {
188 writer.addTags(currentMethod, methodDocTree);
189 }
|
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.toolkit.builders;
27
28 import java.util.*;
29
30 import javax.lang.model.element.Element;
31 import javax.lang.model.element.ExecutableElement;
32 import javax.lang.model.element.TypeElement;
33 import javax.lang.model.type.TypeMirror;
34
35 import jdk.javadoc.internal.doclets.toolkit.BaseOptions;
36 import jdk.javadoc.internal.doclets.toolkit.Content;
37 import jdk.javadoc.internal.doclets.toolkit.DocletException;
38 import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
39 import jdk.javadoc.internal.doclets.toolkit.util.DocFinder;
40
41 import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
42
43 /**
44 * Builds documentation for a method.
45 *
46 * <p><b>This is NOT part of any supported API.
47 * If you write code that depends on this, you do so at your own risk.
48 * This code and its internal interfaces are subject to change or
49 * deletion without notice.</b>
50 */
51 public class MethodBuilder extends AbstractMemberBuilder {
52
53 /**
54 * The index of the current field that is being documented at this point
55 * in time.
144 /**
145 * Build the signature.
146 *
147 * @param methodDocTree the content tree to which the documentation will be added
148 */
149 protected void buildSignature(Content methodDocTree) {
150 methodDocTree.add(writer.getSignature(currentMethod));
151 }
152
153 /**
154 * Build the deprecation information.
155 *
156 * @param methodDocTree the content tree to which the documentation will be added
157 */
158 protected void buildDeprecationInfo(Content methodDocTree) {
159 writer.addDeprecated(currentMethod, methodDocTree);
160 }
161
162 /**
163 * Build the comments for the method. Do nothing if
164 * {@link BaseOptions#noComment} is set to true.
165 *
166 * @param methodDocTree the content tree to which the documentation will be added
167 */
168 protected void buildMethodComments(Content methodDocTree) {
169 if (!options.noComment) {
170 ExecutableElement method = currentMethod;
171 if (utils.getFullBody(currentMethod).isEmpty()) {
172 DocFinder.Output docs = DocFinder.search(configuration,
173 new DocFinder.Input(utils, currentMethod));
174 if (docs.inlineTags != null && !docs.inlineTags.isEmpty())
175 method = (ExecutableElement)docs.holder;
176 }
177 TypeMirror containingType = method.getEnclosingElement().asType();
178 writer.addComments(containingType, method, methodDocTree);
179 }
180 }
181
182 /**
183 * Build the tag information.
184 *
185 * @param methodDocTree the content tree to which the documentation will be added
186 */
187 protected void buildTagInfo(Content methodDocTree) {
188 writer.addTags(currentMethod, methodDocTree);
189 }
|