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 javax.lang.model.element.TypeElement;
29 
30 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
31 
32 /**
33  * The interface for writing annotation type output.
34  *
35  *  <p><b>This is NOT part of any supported API.
36  *  If you write code that depends on this, you do so at your own risk.
37  *  This code and its internal interfaces are subject to change or
38  *  deletion without notice.</b>
39  *
40  * @author Jamie Ho
41  * @author Bhavesh Patel (Modified)
42  */
43 
44 public interface AnnotationTypeWriter {
45 
46     /**
47      * Get the header of the page.
48      *
49      * @param header the header string to write
50      * @return a content tree for the header documentation
51      */
getHeader(String header)52     public Content getHeader(String header);
53 
54     /**
55      * Get the annotation content header.
56      *
57      * @return annotation content header that needs to be added to the documentation
58      */
getAnnotationContentHeader()59     public Content getAnnotationContentHeader();
60 
61     /**
62      * Get the annotation information tree header.
63      *
64      * @return annotation information tree header that needs to be added to the documentation
65      */
getAnnotationInfoTreeHeader()66     public Content getAnnotationInfoTreeHeader();
67 
68     /**
69      * Get the annotation information.
70      *
71      * @param annotationInfoTree content tree containing the annotation information
72      * @return a content tree for the annotation
73      */
getAnnotationInfo(Content annotationInfoTree)74     public Content getAnnotationInfo(Content annotationInfoTree);
75 
76     /**
77      * Add the signature of the current annotation type.
78      *
79      * @param modifiers the modifiers for the signature
80      * @param annotationInfoTree the annotation content tree to which the signature will be added
81      */
addAnnotationTypeSignature(String modifiers, Content annotationInfoTree)82     public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree);
83 
84     /**
85      * Build the annotation type description.
86      *
87      * @param annotationInfoTree content tree to which the description will be added
88      */
addAnnotationTypeDescription(Content annotationInfoTree)89     public void addAnnotationTypeDescription(Content annotationInfoTree);
90 
91     /**
92      * Add the tag information for the current annotation type.
93      *
94      * @param annotationInfoTree content tree to which the tag information will be added
95      */
addAnnotationTypeTagInfo(Content annotationInfoTree)96     public void addAnnotationTypeTagInfo(Content annotationInfoTree);
97 
98     /**
99      * If this annotation is deprecated, add the appropriate information.
100      *
101      * @param annotationInfoTree content tree to which the deprecated information will be added
102      */
addAnnotationTypeDeprecationInfo(Content annotationInfoTree)103     public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree);
104 
105     /**
106      * Get the member tree header for the annotation type.
107      *
108      * @return a content tree for the member tree header
109      */
getMemberTreeHeader()110     public Content getMemberTreeHeader();
111 
112     /**
113      * Add the annotation content tree to the documentation content tree.
114      *
115      * @param contentTree content tree to which the annotation content will be added
116      * @param annotationContentTree annotation content tree which will be added to the content tree
117      */
addAnnotationContentTree(Content contentTree, Content annotationContentTree)118     public void addAnnotationContentTree(Content contentTree, Content annotationContentTree);
119 
120     /**
121      * Get the member tree.
122      *
123      * @param memberTree the content tree that will be modified and returned
124      * @return a content tree for the member
125      */
getMemberTree(Content memberTree)126     public Content getMemberTree(Content memberTree);
127 
128     /**
129      * Get the member summary tree.
130      *
131      * @param memberTree the content tree that will be used to build the summary tree
132      * @return a content tree for the member summary
133      */
getMemberSummaryTree(Content memberTree)134     public Content getMemberSummaryTree(Content memberTree);
135 
136     /**
137      * Get the member details tree.
138      *
139      * @param memberTree the content tree that will be used to build the details tree
140      * @return a content tree for the member details
141      */
getMemberDetailsTree(Content memberTree)142     public Content getMemberDetailsTree(Content memberTree);
143 
144     /**
145      * Add the footer of the page.
146      *
147      * @param contentTree content tree to which the footer will be added
148      */
addFooter(Content contentTree)149     public void addFooter(Content contentTree);
150 
151     /**
152      * Print the document.
153      *
154      * @param contentTree content tree that will be printed as a document
155      * @throws DocFileIOException if there is a problem while writing the document
156      */
printDocument(Content contentTree)157     public void printDocument(Content contentTree) throws DocFileIOException;
158 
159     /**
160      * Return the {@link TypeElement} being documented.
161      *
162      * @return the TypeElement representing the annotation being documented.
163      */
getAnnotationTypeElement()164     public TypeElement getAnnotationTypeElement();
165 }
166