src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java

Fri, 03 Dec 2010 20:31:57 -0800

author
mfang
date
Fri, 03 Dec 2010 20:31:57 -0800
changeset 762
4f086529d05c
parent 554
9d9f26857129
child 766
90af8d87741f
permissions
-rw-r--r--

6522789: [zh_CN] translation of "enclosing class" in doclet is incorrect
Reviewed-by: yhuang

duke@1 1 /*
ohair@554 2 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
ohair@554 7 * published by the Free Software Foundation. Oracle designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
ohair@554 9 * by Oracle in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
ohair@554 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 22 * or visit www.oracle.com if you need additional information or have any
ohair@554 23 * questions.
duke@1 24 */
duke@1 25
duke@1 26 package com.sun.tools.doclets.formats.html;
duke@1 27
bpatel@233 28 import java.io.*;
bpatel@233 29
bpatel@233 30 import com.sun.javadoc.*;
duke@1 31 import com.sun.tools.doclets.internal.toolkit.*;
duke@1 32
duke@1 33 /**
duke@1 34 * Writes annotation type optional member documentation in HTML format.
duke@1 35 *
duke@1 36 * @author Jamie Ho
bpatel@243 37 * @author Bhavesh Patel (Modified)
duke@1 38 */
duke@1 39 public class AnnotationTypeOptionalMemberWriterImpl extends
duke@1 40 AnnotationTypeRequiredMemberWriterImpl
duke@1 41 implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter {
duke@1 42
duke@1 43 /**
duke@1 44 * Construct a new AnnotationTypeOptionalMemberWriterImpl.
duke@1 45 *
duke@1 46 * @param writer the writer that will write the output.
duke@1 47 * @param annotationType the AnnotationType that holds this member.
duke@1 48 */
duke@1 49 public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer,
duke@1 50 AnnotationTypeDoc annotationType) {
duke@1 51 super(writer, annotationType);
duke@1 52 }
duke@1 53
duke@1 54 /**
duke@1 55 * {@inheritDoc}
duke@1 56 */
duke@1 57 public void writeMemberSummaryHeader(ClassDoc classDoc) {
duke@1 58 writer.println("<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->");
duke@1 59 writer.println();
duke@1 60 writer.printSummaryHeader(this, classDoc);
duke@1 61 }
duke@1 62
duke@1 63 /**
duke@1 64 * {@inheritDoc}
duke@1 65 */
duke@1 66 public void writeDefaultValueInfo(MemberDoc member) {
bpatel@233 67 if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
bpatel@233 68 writer.printMemberDetailsListStartTag();
bpatel@233 69 writer.dd();
bpatel@233 70 writer.dl();
bpatel@233 71 writer.dt();
bpatel@233 72 writer.strong(ConfigurationImpl.getInstance().
bpatel@233 73 getText("doclet.Default"));
bpatel@233 74 writer.dtEnd();
bpatel@233 75 writer.dd();
bpatel@233 76 writer.print(((AnnotationTypeElementDoc) member).defaultValue());
bpatel@233 77 writer.ddEnd();
bpatel@233 78 writer.dlEnd();
bpatel@233 79 writer.ddEnd();
bpatel@233 80 }
duke@1 81 }
duke@1 82
duke@1 83 /**
duke@1 84 * {@inheritDoc}
duke@1 85 */
duke@1 86 public void close() throws IOException {
duke@1 87 writer.close();
duke@1 88 }
duke@1 89
duke@1 90 /**
duke@1 91 * {@inheritDoc}
duke@1 92 */
bpatel@243 93 public void printSummaryLabel() {
bpatel@243 94 writer.printText("doclet.Annotation_Type_Optional_Member_Summary");
bpatel@243 95 }
bpatel@243 96
bpatel@243 97 /**
bpatel@243 98 * {@inheritDoc}
bpatel@243 99 */
bpatel@243 100 public void printTableSummary() {
bpatel@243 101 writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
bpatel@243 102 configuration().getText("doclet.Annotation_Type_Optional_Member_Summary"),
bpatel@243 103 configuration().getText("doclet.annotation_type_optional_members")));
bpatel@243 104 }
bpatel@243 105
bpatel@243 106 public void printSummaryTableHeader(ProgramElementDoc member) {
bpatel@243 107 String[] header = new String[] {
bpatel@243 108 writer.getModifierTypeHeader(),
bpatel@243 109 configuration().getText("doclet.0_and_1",
bpatel@243 110 configuration().getText("doclet.Annotation_Type_Optional_Member"),
bpatel@243 111 configuration().getText("doclet.Description"))
bpatel@243 112 };
bpatel@243 113 writer.summaryTableHeader(header, "col");
duke@1 114 }
duke@1 115
duke@1 116 /**
duke@1 117 * {@inheritDoc}
duke@1 118 */
duke@1 119 public void printSummaryAnchor(ClassDoc cd) {
duke@1 120 writer.anchor("annotation_type_optional_element_summary");
duke@1 121 }
duke@1 122
duke@1 123 /**
duke@1 124 * {@inheritDoc}
duke@1 125 */
duke@1 126 protected void printNavSummaryLink(ClassDoc cd, boolean link) {
duke@1 127 if (link) {
duke@1 128 writer.printHyperLink("", "annotation_type_optional_element_summary",
duke@1 129 configuration().getText("doclet.navAnnotationTypeOptionalMember"));
duke@1 130 } else {
duke@1 131 writer.printText("doclet.navAnnotationTypeOptionalMember");
duke@1 132 }
duke@1 133 }
duke@1 134 }

mercurial