Thu, 02 Oct 2008 19:58:40 -0700
6754988: Update copyright year
Summary: Update for files that have been modified starting July 2008
Reviewed-by: ohair, tbell
1 /*
2 * Copyright 2003 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any 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 * This code is not part of an API.
40 * It is implementation that is subject to change.
41 * Do not use it as an API
42 *
43 * @since 1.5
44 * @author Jamie Ho
45 */
47 public class LegacyTaglet implements Taglet {
49 private com.sun.tools.doclets.Taglet legacyTaglet;
51 public LegacyTaglet(com.sun.tools.doclets.Taglet t) {
52 legacyTaglet = t;
53 }
55 /**
56 * {@inheritDoc}
57 */
58 public boolean inField() {
59 return legacyTaglet.isInlineTag() || legacyTaglet.inField();
60 }
62 /**
63 * {@inheritDoc}
64 */
65 public boolean inConstructor() {
66 return legacyTaglet.isInlineTag() || legacyTaglet.inConstructor();
67 }
69 /**
70 * {@inheritDoc}
71 */
72 public boolean inMethod() {
73 return legacyTaglet.isInlineTag() || legacyTaglet.inMethod();
74 }
76 /**
77 * {@inheritDoc}
78 */
79 public boolean inOverview() {
80 return legacyTaglet.isInlineTag() || legacyTaglet.inOverview();
81 }
83 /**
84 * {@inheritDoc}
85 */
86 public boolean inPackage() {
87 return legacyTaglet.isInlineTag() || legacyTaglet.inPackage();
88 }
90 /**
91 * {@inheritDoc}
92 */
93 public boolean inType() {
94 return legacyTaglet.isInlineTag() || legacyTaglet.inType();
95 }
97 /**
98 * Return true if this <code>Taglet</code>
99 * is an inline tag.
100 * @return true if this <code>Taglet</code>
101 * is an inline tag and false otherwise.
102 */
103 public boolean isInlineTag() {
104 return legacyTaglet.isInlineTag();
105 }
107 /**
108 * {@inheritDoc}
109 */
110 public String getName() {
111 return legacyTaglet.getName();
112 }
114 /**
115 * {@inheritDoc}
116 */
117 public TagletOutput getTagletOutput(Tag tag, TagletWriter writer)
118 throws IllegalArgumentException {
119 TagletOutput output = writer.getOutputInstance();
120 output.setOutput(legacyTaglet.toString(tag));
121 return output;
122 }
124 /**
125 * {@inheritDoc}
126 */
127 public TagletOutput getTagletOutput(Doc holder, TagletWriter writer)
128 throws IllegalArgumentException {
129 TagletOutput output = writer.getOutputInstance();
130 output.setOutput(legacyTaglet.toString(holder.tags(getName())));
131 return output;
132 }
133 }