Wed, 10 Oct 2012 16:48:21 -0700
8000665: fix "internal API" comments on javadoc files
Reviewed-by: darcy
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.taglets;
28 import com.sun.javadoc.*;
30 /**
31 * This taglet acts as a wrapper to enable
32 * {@link com.sun.tools.doclets.Taglet} type taglets to work
33 * with the current version of Javadoc.
34 * Note: this taglet only works with legacy taglets (those compatible with
35 * Javadoc 1.4.x) that writes strings.
36 * This taglet is able to wrap most most legacy taglets because
37 * the standard doclet is the only known doclet to use legacy taglets.
38 *
39 * <p><b>This is NOT part of any supported API.
40 * If you write code that depends on this, you do so at your own risk.
41 * This code and its internal interfaces are subject to change or
42 * deletion without notice.</b>
43 *
44 * @since 1.5
45 * @author Jamie Ho
46 */
48 public class LegacyTaglet implements Taglet {
50 private com.sun.tools.doclets.Taglet legacyTaglet;
52 public LegacyTaglet(com.sun.tools.doclets.Taglet t) {
53 legacyTaglet = t;
54 }
56 /**
57 * {@inheritDoc}
58 */
59 public boolean inField() {
60 return legacyTaglet.isInlineTag() || legacyTaglet.inField();
61 }
63 /**
64 * {@inheritDoc}
65 */
66 public boolean inConstructor() {
67 return legacyTaglet.isInlineTag() || legacyTaglet.inConstructor();
68 }
70 /**
71 * {@inheritDoc}
72 */
73 public boolean inMethod() {
74 return legacyTaglet.isInlineTag() || legacyTaglet.inMethod();
75 }
77 /**
78 * {@inheritDoc}
79 */
80 public boolean inOverview() {
81 return legacyTaglet.isInlineTag() || legacyTaglet.inOverview();
82 }
84 /**
85 * {@inheritDoc}
86 */
87 public boolean inPackage() {
88 return legacyTaglet.isInlineTag() || legacyTaglet.inPackage();
89 }
91 /**
92 * {@inheritDoc}
93 */
94 public boolean inType() {
95 return legacyTaglet.isInlineTag() || legacyTaglet.inType();
96 }
98 /**
99 * Return true if this <code>Taglet</code>
100 * is an inline tag.
101 * @return true if this <code>Taglet</code>
102 * is an inline tag and false otherwise.
103 */
104 public boolean isInlineTag() {
105 return legacyTaglet.isInlineTag();
106 }
108 /**
109 * {@inheritDoc}
110 */
111 public String getName() {
112 return legacyTaglet.getName();
113 }
115 /**
116 * {@inheritDoc}
117 */
118 public TagletOutput getTagletOutput(Tag tag, TagletWriter writer)
119 throws IllegalArgumentException {
120 TagletOutput output = writer.getOutputInstance();
121 output.setOutput(legacyTaglet.toString(tag));
122 return output;
123 }
125 /**
126 * {@inheritDoc}
127 */
128 public TagletOutput getTagletOutput(Doc holder, TagletWriter writer)
129 throws IllegalArgumentException {
130 TagletOutput output = writer.getOutputInstance();
131 output.setOutput(legacyTaglet.toString(holder.tags(getName())));
132 return output;
133 }
134 }