10
|
1 |
/*
|
5520
|
2 |
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
10
|
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
|
5520
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
10
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5520
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
10
|
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 |
*
|
5520
|
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.
|
10
|
24 |
*/
|
|
25 |
|
|
26 |
package com.sun.tools.doclets.internal.toolkit;
|
|
27 |
|
|
28 |
import com.sun.tools.doclets.internal.toolkit.util.*;
|
|
29 |
import com.sun.javadoc.*;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* The interface for a factory creates writers.
|
|
33 |
*
|
|
34 |
* This code is not part of an API.
|
|
35 |
* It is implementation that is subject to change.
|
|
36 |
* Do not use it as an API
|
|
37 |
*
|
|
38 |
* @author Jamie Ho
|
|
39 |
* @since 1.4
|
|
40 |
*/
|
|
41 |
|
|
42 |
public interface WriterFactory {
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Return the writer for the constant summary.
|
|
46 |
*
|
|
47 |
* @return the writer for the constant summary. Return null if this
|
|
48 |
* writer is not supported by the doclet.
|
|
49 |
*/
|
|
50 |
public abstract ConstantsSummaryWriter getConstantsSummaryWriter()
|
|
51 |
throws Exception;
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Return the writer for the package summary.
|
|
55 |
*
|
|
56 |
* @param packageDoc the package being documented.
|
|
57 |
* @param prevPkg the previous package that was documented.
|
|
58 |
* @param nextPkg the next package being documented.
|
|
59 |
* @return the writer for the package summary. Return null if this
|
|
60 |
* writer is not supported by the doclet.
|
|
61 |
*/
|
|
62 |
public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc
|
|
63 |
packageDoc, PackageDoc prevPkg, PackageDoc nextPkg)
|
|
64 |
throws Exception;
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Return the writer for a class.
|
|
68 |
*
|
|
69 |
* @param classDoc the class being documented.
|
|
70 |
* @param prevClass the previous class that was documented.
|
|
71 |
* @param nextClass the next class being documented.
|
|
72 |
* @param classTree the class tree.
|
|
73 |
* @return the writer for the class. Return null if this
|
|
74 |
* writer is not supported by the doclet.
|
|
75 |
*/
|
|
76 |
public abstract ClassWriter getClassWriter(ClassDoc classDoc,
|
|
77 |
ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
|
|
78 |
throws Exception;
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Return the writer for an annotation type.
|
|
82 |
*
|
|
83 |
* @param annotationType the type being documented.
|
|
84 |
* @param prevType the previous type that was documented.
|
|
85 |
* @param nextType the next type being documented.
|
|
86 |
* @return the writer for the annotation type. Return null if this
|
|
87 |
* writer is not supported by the doclet.
|
|
88 |
*/
|
|
89 |
public abstract AnnotationTypeWriter getAnnotationTypeWriter(
|
|
90 |
AnnotationTypeDoc annotationType, Type prevType, Type nextType)
|
|
91 |
throws Exception;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Return the method writer for a given class.
|
|
95 |
*
|
|
96 |
* @param classWriter the writer for the class being documented.
|
|
97 |
* @return the method writer for the give class. Return null if this
|
|
98 |
* writer is not supported by the doclet.
|
|
99 |
*/
|
|
100 |
public abstract MethodWriter getMethodWriter(ClassWriter classWriter)
|
|
101 |
throws Exception;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Return the annotation type optional member writer for a given annotation
|
|
105 |
* type.
|
|
106 |
*
|
|
107 |
* @param annotationTypeWriter the writer for the annotation type
|
|
108 |
* being documented.
|
|
109 |
* @return the member writer for the given annotation type. Return null if
|
|
110 |
* this writer is not supported by the doclet.
|
|
111 |
*/
|
|
112 |
public abstract AnnotationTypeOptionalMemberWriter
|
|
113 |
getAnnotationTypeOptionalMemberWriter(
|
|
114 |
AnnotationTypeWriter annotationTypeWriter) throws Exception;
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Return the annotation type required member writer for a given annotation type.
|
|
118 |
*
|
|
119 |
* @param annotationTypeWriter the writer for the annotation type
|
|
120 |
* being documented.
|
|
121 |
* @return the member writer for the given annotation type. Return null if
|
|
122 |
* this writer is not supported by the doclet.
|
|
123 |
*/
|
|
124 |
public abstract AnnotationTypeRequiredMemberWriter
|
|
125 |
getAnnotationTypeRequiredMemberWriter(
|
|
126 |
AnnotationTypeWriter annotationTypeWriter) throws Exception;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Return the enum constant writer for a given class.
|
|
130 |
*
|
|
131 |
* @param classWriter the writer for the class being documented.
|
|
132 |
* @return the enum constant writer for the give class. Return null if this
|
|
133 |
* writer is not supported by the doclet.
|
|
134 |
*/
|
|
135 |
public abstract EnumConstantWriter getEnumConstantWriter(
|
|
136 |
ClassWriter classWriter) throws Exception;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Return the field writer for a given class.
|
|
140 |
*
|
|
141 |
* @param classWriter the writer for the class being documented.
|
|
142 |
* @return the field writer for the give class. Return null if this
|
|
143 |
* writer is not supported by the doclet.
|
|
144 |
*/
|
|
145 |
public abstract FieldWriter getFieldWriter(ClassWriter classWriter)
|
|
146 |
throws Exception;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Return the constructor writer for a given class.
|
|
150 |
*
|
|
151 |
* @param classWriter the writer for the class being documented.
|
|
152 |
* @return the method writer for the give class. Return null if this
|
|
153 |
* writer is not supported by the doclet.
|
|
154 |
*/
|
|
155 |
public abstract ConstructorWriter getConstructorWriter(
|
|
156 |
ClassWriter classWriter)
|
|
157 |
throws Exception;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Return the specified member summary writer for a given class.
|
|
161 |
*
|
|
162 |
* @param classWriter the writer for the class being documented.
|
|
163 |
* @param memberType the {@link VisibleMemberMap} member type indicating
|
|
164 |
* the type of member summary that should be returned.
|
|
165 |
* @return the summary writer for the give class. Return null if this
|
|
166 |
* writer is not supported by the doclet.
|
|
167 |
*
|
|
168 |
* @see VisibleMemberMap
|
|
169 |
* @throws IllegalArgumentException if memberType is unknown.
|
|
170 |
*/
|
|
171 |
public abstract MemberSummaryWriter getMemberSummaryWriter(
|
|
172 |
ClassWriter classWriter, int memberType)
|
|
173 |
throws Exception;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Return the specified member summary writer for a given annotation type.
|
|
177 |
*
|
|
178 |
* @param annotationTypeWriter the writer for the annotation type being
|
|
179 |
* documented.
|
|
180 |
* @param memberType the {@link VisibleMemberMap} member type indicating
|
|
181 |
* the type of member summary that should be returned.
|
|
182 |
* @return the summary writer for the give class. Return null if this
|
|
183 |
* writer is not supported by the doclet.
|
|
184 |
*
|
|
185 |
* @see VisibleMemberMap
|
|
186 |
* @throws IllegalArgumentException if memberType is unknown.
|
|
187 |
*/
|
|
188 |
public abstract MemberSummaryWriter getMemberSummaryWriter(
|
|
189 |
AnnotationTypeWriter annotationTypeWriter, int memberType)
|
|
190 |
throws Exception;
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Return the writer for the serialized form.
|
|
194 |
*
|
|
195 |
* @return the writer for the serialized form.
|
|
196 |
*/
|
|
197 |
public SerializedFormWriter getSerializedFormWriter() throws Exception;
|
|
198 |
}
|