AnnotationTypeWriter.java revision 3233:b5d08bc0d224
1234353Sdim/*
2224133Sdim * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3224133Sdim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4224133Sdim *
5224133Sdim * This code is free software; you can redistribute it and/or modify it
6224133Sdim * under the terms of the GNU General Public License version 2 only, as
7224133Sdim * published by the Free Software Foundation.  Oracle designates this
8224133Sdim * particular file as subject to the "Classpath" exception as provided
9224133Sdim * by Oracle in the LICENSE file that accompanied this code.
10224133Sdim *
11224133Sdim * This code is distributed in the hope that it will be useful, but WITHOUT
12224133Sdim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13224133Sdim * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14226633Sdim * version 2 for more details (a copy is included in the LICENSE file that
15276479Sdim * accompanied this code).
16249423Sdim *
17276479Sdim * You should have received a copy of the GNU General Public License version
18276479Sdim * 2 along with this work; if not, write to the Free Software Foundation,
19261991Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20276479Sdim *
21226633Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22261991Sdim * or visit www.oracle.com if you need additional information or have any
23224133Sdim * questions.
24224133Sdim */
25224133Sdim
26261991Sdimpackage jdk.javadoc.internal.doclets.toolkit;
27249423Sdim
28261991Sdimimport java.io.*;
29234353Sdim
30261991Sdimimport javax.lang.model.element.TypeElement;
31226633Sdim
32224133Sdim/**
33276479Sdim * The interface for writing annotation type output.
34276479Sdim *
35224133Sdim *  <p><b>This is NOT part of any supported API.
36224133Sdim *  If you write code that depends on this, you do so at your own risk.
37224133Sdim *  This code and its internal interfaces are subject to change or
38224133Sdim *  deletion without notice.</b>
39224133Sdim *
40224133Sdim * @author Jamie Ho
41224133Sdim * @author Bhavesh Patel (Modified)
42224133Sdim */
43224133Sdim
44276479Sdimpublic interface AnnotationTypeWriter {
45276479Sdim
46288943Sdim    /**
47276479Sdim     * Get the header of the page.
48288943Sdim     *
49276479Sdim     * @param header the header string to write
50276479Sdim     * @return a content tree for the header documentation
51276479Sdim     */
52234982Sdim    public Content getHeader(String header);
53276479Sdim
54234982Sdim    /**
55234982Sdim     * Get the annotation content header.
56224133Sdim     *
57224133Sdim     * @return annotation content header that needs to be added to the documentation
58224133Sdim     */
59224133Sdim    public Content getAnnotationContentHeader();
60224133Sdim
61224133Sdim    /**
62288943Sdim     * Get the annotation information tree header.
63226633Sdim     *
64226633Sdim     * @return annotation information tree header that needs to be added to the documentation
65226633Sdim     */
66224133Sdim    public Content getAnnotationInfoTreeHeader();
67224133Sdim
68288943Sdim    /**
69288943Sdim     * Get the annotation information.
70288943Sdim     *
71288943Sdim     * @param annotationInfoTree content tree containing the annotation information
72224133Sdim     * @return a content tree for the annotation
73224133Sdim     */
74288943Sdim    public Content getAnnotationInfo(Content annotationInfoTree);
75288943Sdim
76261991Sdim    /**
77226633Sdim     * Add the signature of the current annotation type.
78261991Sdim     *
79276479Sdim     * @param modifiers the modifiers for the signature
80261991Sdim     * @param annotationInfoTree the annotation content tree to which the signature will be added
81226633Sdim     */
82226633Sdim    public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree);
83226633Sdim
84226633Sdim    /**
85288943Sdim     * Build the annotation type description.
86234353Sdim     *
87234353Sdim     * @param annotationInfoTree content tree to which the description will be added
88226633Sdim     */
89234353Sdim    public void addAnnotationTypeDescription(Content annotationInfoTree);
90234353Sdim
91234353Sdim    /**
92226633Sdim     * Add the tag information for the current annotation type.
93288943Sdim     *
94226633Sdim     * @param annotationInfoTree content tree to which the tag information will be added
95226633Sdim     */
96226633Sdim    public void addAnnotationTypeTagInfo(Content annotationInfoTree);
97288943Sdim
98226633Sdim    /**
99226633Sdim     * If this annotation is deprecated, add the appropriate information.
100234353Sdim     *
101288943Sdim     * @param annotationInfoTree content tree to which the deprecated information will be added
102234353Sdim     */
103226633Sdim    public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree);
104226633Sdim
105288943Sdim    /**
106288943Sdim     * Get the member tree header for the annotation type.
107288943Sdim     *
108276479Sdim     * @return a content tree for the member tree header
109288943Sdim     */
110288943Sdim    public Content getMemberTreeHeader();
111276479Sdim
112288943Sdim    /**
113276479Sdim     * Add the annotation content tree to the documentation content tree.
114261991Sdim     *
115226633Sdim     * @param contentTree content tree to which the annotation content will be added
116288943Sdim     * @param annotationContentTree annotation content tree which will be added to the content tree
117288943Sdim     */
118288943Sdim    public void addAnnotationContentTree(Content contentTree, Content annotationContentTree);
119288943Sdim
120288943Sdim    /**
121276479Sdim     * Get the member tree.
122261991Sdim     *
123288943Sdim     * @param memberTree the content tree that will be modified and returned
124288943Sdim     * @return a content tree for the member
125226633Sdim     */
126226633Sdim    public Content getMemberTree(Content memberTree);
127288943Sdim
128288943Sdim    /**
129288943Sdim     * Get the member summary tree.
130288943Sdim     *
131288943Sdim     * @param memberTree the content tree that will be used to build the summary tree
132226633Sdim     * @return a content tree for the member summary
133288943Sdim     */
134288943Sdim    public Content getMemberSummaryTree(Content memberTree);
135288943Sdim
136288943Sdim    /**
137226633Sdim     * Get the member details tree.
138288943Sdim     *
139288943Sdim     * @param memberTree the content tree that will be used to build the details tree
140226633Sdim     * @return a content tree for the member details
141288943Sdim     */
142288943Sdim    public Content getMemberDetailsTree(Content memberTree);
143226633Sdim
144288943Sdim    /**
145288943Sdim     * Add the footer of the page.
146226633Sdim     *
147288943Sdim     * @param contentTree content tree to which the footer will be added
148288943Sdim     */
149226633Sdim    public void addFooter(Content contentTree);
150288943Sdim
151288943Sdim    /**
152226633Sdim     * Print the document.
153288943Sdim     *
154288943Sdim     * @param contentTree content tree that will be printed as a document
155261991Sdim     */
156288943Sdim    public void printDocument(Content contentTree) throws IOException;
157288943Sdim
158276479Sdim    /**
159288943Sdim     * Close the writer.
160288943Sdim     */
161288943Sdim    public void close() throws IOException;
162288943Sdim
163288943Sdim    /**
164288943Sdim     * Return the {@link TypeElement} being documented.
165288943Sdim     *
166288943Sdim     * @return the TypeElement representing the annotation being documented.
167288943Sdim     */
168288943Sdim    public TypeElement getAnnotationTypeElement();
169288943Sdim}
170288943Sdim