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 
  33 /**
  34  * The interface for writing constructor output.
  35  *
  36  *  <p><b>This is NOT part of any supported API.
  37  *  If you write code that depends on this, you do so at your own risk.
  38  *  This code and its internal interfaces are subject to change or
  39  *  deletion without notice.</b>
  40  *
  41  * @author Jamie Ho
  42  * @author Bhavesh Patel (Modified)
  43  */
  44 
  45 public interface ConstructorWriter {
  46 
  47     /**
  48      * Get the constructor details tree header.
  49      *
  50      * @param typeElement the class being documented
  51      * @param memberDetailsTree the content tree representing member details
  52      * @return content tree for the constructor details header
  53      */
  54     public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
  55             Content memberDetailsTree);
  56 
  57     /**
  58      * Get the constructor documentation tree header.
  59      *
  60      * @param constructor the constructor being documented
  61      * @param constructorDetailsTree the content tree representing constructor details
  62      * @return content tree for the constructor documentation header
  63      */
  64     public Content getConstructorDocTreeHeader(ExecutableElement constructor,
  65             Content constructorDetailsTree);
  66 
  67     /**
  68      * Get the signature for the given constructor.
  69      *
  70      * @param constructor the constructor being documented
  71      * @return content tree for the constructor signature
  72      */
  73     public Content getSignature(ExecutableElement constructor);
  74 
  75     /**
  76      * Add the deprecated output for the given constructor.
  77      *
  78      * @param constructor the constructor being documented
  79      * @param constructorDocTree content tree to which the deprecated information will be added
  80      */
  81     public void addDeprecated(ExecutableElement constructor, Content constructorDocTree);
  82 
  83     /**
  84      * Add the comments for the given constructor.
  85      *
  86      * @param constructor the constructor being documented
  87      * @param constructorDocTree the content tree to which the comments will be added
  88      */
  89     public void addComments(ExecutableElement constructor, Content constructorDocTree);
  90 
  91     /**
  92      * Add the tags for the given constructor.
  93      *
  94      * @param constructor the constructor being documented
  95      * @param constructorDocTree the content tree to which the tags will be added
  96      */
  97     public void addTags(ExecutableElement constructor, Content constructorDocTree);
  98 
  99     /**
 100      * Get the constructor details tree.
 101      *
 102      * memberDetailsTreeHeader the content tree representing member details header
 103      * @param memberDetailsTree the content tree representing member details
 104      * @return content tree for the constructor details
 105      */
 106     public Content getConstructorDetails(Content memberDetailsTreeHeader, Content memberDetailsTree);
 107 
 108     /**
 109      * Get the constructor documentation.
 110      *
 111      * @param constructorDocTree the content tree representing constructor documentation
 112      * @param isLastContent true if the content to be added is the last content
 113      * @return content tree for the constructor documentation
 114      */
 115     public Content getConstructorDoc(Content constructorDocTree, boolean isLastContent);
 116 
 117     /**
 118      * Let the writer know whether a non public constructor was found.
 119      *
 120      * @param foundNonPubConstructor true if we found a non public constructor.
 121      */
 122     public void setFoundNonPubConstructor(boolean foundNonPubConstructor);
 123 
 124     /**
 125      * Gets the member header tree.
 126      *
 127      * @return a content tree for the member header
 128      */
 129     public Content getMemberTreeHeader();
 130 }