author | jjg |
Fri, 27 May 2016 13:06:58 -0700 | |
changeset 38617 | d93a7f64e231 |
parent 25874 | 83c19f00452c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
14258 | 2 |
* Copyright (c) 2003, 2012, 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.builders; |
|
27 |
||
14258 | 28 |
import com.sun.javadoc.*; |
10 | 29 |
import com.sun.tools.doclets.internal.toolkit.*; |
14258 | 30 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
10 | 31 |
|
32 |
/** |
|
33 |
* Builds documentation for optional annotation type members. |
|
34 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
35 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
36 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
37 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
38 |
* deletion without notice.</b> |
10 | 39 |
* |
40 |
* @author Jamie Ho |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
41 |
* @author Bhavesh Patel (Modified) |
10 | 42 |
* @since 1.5 |
43 |
*/ |
|
38617 | 44 |
@Deprecated |
10 | 45 |
public class AnnotationTypeOptionalMemberBuilder extends |
14542 | 46 |
AnnotationTypeRequiredMemberBuilder { |
10 | 47 |
|
48 |
||
49 |
/** |
|
50 |
* Construct a new AnnotationTypeMemberBuilder. |
|
51 |
* |
|
14542 | 52 |
* @param context the build context. |
53 |
* @param classDoc the class whose members are being documented. |
|
54 |
* @param writer the doclet specific writer. |
|
10 | 55 |
*/ |
14542 | 56 |
private AnnotationTypeOptionalMemberBuilder(Context context, |
57 |
ClassDoc classDoc, |
|
58 |
AnnotationTypeOptionalMemberWriter writer) { |
|
59 |
super(context, classDoc, writer, |
|
60 |
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL); |
|
10 | 61 |
} |
62 |
||
63 |
||
64 |
/** |
|
65 |
* Construct a new AnnotationTypeMemberBuilder. |
|
66 |
* |
|
14542 | 67 |
* @param context the build context. |
68 |
* @param classDoc the class whose members are being documented. |
|
10 | 69 |
* @param writer the doclet specific writer. |
70 |
*/ |
|
71 |
public static AnnotationTypeOptionalMemberBuilder getInstance( |
|
14542 | 72 |
Context context, ClassDoc classDoc, |
10 | 73 |
AnnotationTypeOptionalMemberWriter writer) { |
14542 | 74 |
return new AnnotationTypeOptionalMemberBuilder(context, |
75 |
classDoc, writer); |
|
10 | 76 |
} |
77 |
||
78 |
/** |
|
79 |
* {@inheritDoc} |
|
80 |
*/ |
|
5855 | 81 |
@Override |
10 | 82 |
public String getName() { |
83 |
return "AnnotationTypeOptionalMemberDetails"; |
|
84 |
} |
|
85 |
||
86 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
87 |
* Build the annotation type optional member documentation. |
10 | 88 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
89 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
90 |
* @param memberDetailsTree the content tree to which the documentation will be added |
10 | 91 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
92 |
public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
93 |
buildAnnotationTypeMember(node, memberDetailsTree); |
10 | 94 |
} |
95 |
||
96 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
97 |
* Build the default value for this optional member. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
98 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
99 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
100 |
* @param annotationDocTree the content tree to which the documentation will be added |
10 | 101 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
102 |
public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
103 |
((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
104 |
(MemberDoc) members.get(currentMemberIndex), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
105 |
annotationDocTree); |
10 | 106 |
} |
107 |
||
108 |
/** |
|
109 |
* {@inheritDoc} |
|
110 |
*/ |
|
5855 | 111 |
@Override |
10 | 112 |
public AnnotationTypeRequiredMemberWriter getWriter() { |
113 |
return writer; |
|
114 |
} |
|
115 |
} |