1 /*
   2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  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;
  27 
  28 import java.io.*;
  29 
  30 import javax.lang.model.element.ExecutableElement;
  31 import javax.lang.model.element.TypeElement;
  32 import javax.lang.model.type.TypeMirror;
  33 
  34 /**
  35  * The interface for writing method output.
  36  *
  37  *  <p><b>This is NOT part of any supported API.
  38  *  If you write code that depends on this, you do so at your own risk.
  39  *  This code and its internal interfaces are subject to change or
  40  *  deletion without notice.</b>
  41  *
  42  * @author Jamie Ho
  43  * @author Bhavesh Patel (Modified)
  44  */
  45 
  46 public interface MethodWriter {
  47 
  48     /**
  49      * Get the method details tree header.
  50      *
  51      * @param typeElement the class being documented
  52      * @param memberDetailsTree the content tree representing member details
  53      * @return content tree for the method details header
  54      */
  55     public Content getMethodDetailsTreeHeader(TypeElement typeElement,
  56             Content memberDetailsTree);
  57 
  58     /**
  59      * Get the method documentation tree header.
  60      *
  61      * @param method the method being documented
  62      * @param methodDetailsTree the content tree representing method details
  63      * @return content tree for the method documentation header
  64      */
  65     public Content getMethodDocTreeHeader(ExecutableElement method,
  66             Content methodDetailsTree);
  67 
  68     /**
  69      * Get the signature for the given method.
  70      *
  71      * @param method the method being documented
  72      * @return content tree for the method signature
  73      */
  74     public Content getSignature(ExecutableElement method);
  75 
  76     /**
  77      * Add the deprecated output for the given method.
  78      *
  79      * @param method the method being documented
  80      * @param methodDocTree content tree to which the deprecated information will be added
  81      */
  82     public void addDeprecated(ExecutableElement method, Content methodDocTree);
  83 
  84     /**
  85      * Add the comments for the given method.
  86      *
  87      * @param holder the holder type (not erasure) of the method
  88      * @param method the method being documented
  89      * @param methodDocTree the content tree to which the comments will be added
  90      */
  91     public void addComments(TypeMirror holder, ExecutableElement method, Content methodDocTree);
  92 
  93     /**
  94      * Add the tags for the given method.
  95      *
  96      * @param method the method being documented
  97      * @param methodDocTree the content tree to which the tags will be added
  98      */
  99     public void addTags(ExecutableElement method, Content methodDocTree);
 100 
 101     /**
 102      * Get the method details tree.
 103      *
 104      * @param methodDetailsTreeHeader the content tree representing method details header
 105      * @param methodDetailsTree the content tree representing method details
 106      * @return content tree for the method details
 107      */
 108     public Content getMethodDetails(Content methodDetailsTreeHeader, Content methodDetailsTree);
 109 
 110     /**
 111      * Get the method documentation.
 112      *
 113      * @param methodDocTree the content tree representing method documentation
 114      * @param isLastContent true if the content to be added is the last content
 115      * @return content tree for the method documentation
 116      */
 117     public Content getMethodDoc(Content methodDocTree, boolean isLastContent);
 118 
 119     /**
 120      * Gets the member header tree.
 121      *
 122      * @return a content tree for the member header
 123      */
 124     public Content getMemberTreeHeader();
 125 }