Thu, 15 Nov 2012 09:18:36 -0800
8000800: javadoc uses static non-final fields
Reviewed-by: bpatel
1 /*
2 * Copyright (c) 2003, 2012, 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 */
26 package com.sun.tools.doclets.internal.toolkit.builders;
28 import com.sun.javadoc.*;
29 import com.sun.tools.doclets.internal.toolkit.*;
30 import com.sun.tools.doclets.internal.toolkit.util.*;
32 /**
33 * Builds documentation for optional annotation type members.
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 * @since 1.5
43 */
44 public class AnnotationTypeOptionalMemberBuilder extends
45 AnnotationTypeRequiredMemberBuilder {
48 /**
49 * Construct a new AnnotationTypeMemberBuilder.
50 *
51 * @param context the build context.
52 * @param classDoc the class whose members are being documented.
53 * @param writer the doclet specific writer.
54 */
55 private AnnotationTypeOptionalMemberBuilder(Context context,
56 ClassDoc classDoc,
57 AnnotationTypeOptionalMemberWriter writer) {
58 super(context, classDoc, writer,
59 VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL);
60 }
63 /**
64 * Construct a new AnnotationTypeMemberBuilder.
65 *
66 * @param context the build context.
67 * @param classDoc the class whose members are being documented.
68 * @param writer the doclet specific writer.
69 */
70 public static AnnotationTypeOptionalMemberBuilder getInstance(
71 Context context, ClassDoc classDoc,
72 AnnotationTypeOptionalMemberWriter writer) {
73 return new AnnotationTypeOptionalMemberBuilder(context,
74 classDoc, writer);
75 }
77 /**
78 * {@inheritDoc}
79 */
80 @Override
81 public String getName() {
82 return "AnnotationTypeOptionalMemberDetails";
83 }
85 /**
86 * Build the annotation type optional member documentation.
87 *
88 * @param node the XML element that specifies which components to document
89 * @param memberDetailsTree the content tree to which the documentation will be added
90 */
91 public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) {
92 buildAnnotationTypeMember(node, memberDetailsTree);
93 }
95 /**
96 * Build the default value for this optional member.
97 *
98 * @param node the XML element that specifies which components to document
99 * @param annotationDocTree the content tree to which the documentation will be added
100 */
101 public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) {
102 ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo(
103 (MemberDoc) members.get(currentMemberIndex),
104 annotationDocTree);
105 }
107 /**
108 * {@inheritDoc}
109 */
110 @Override
111 public AnnotationTypeRequiredMemberWriter getWriter() {
112 return writer;
113 }
114 }