10
|
1 |
/*
|
14260
|
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.taglets;
|
|
27 |
|
|
28 |
import com.sun.javadoc.*;
|
|
29 |
|
|
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 |
*
|
14260
|
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>
|
10
|
43 |
*
|
|
44 |
* @since 1.5
|
|
45 |
* @author Jamie Ho
|
|
46 |
*/
|
|
47 |
|
|
48 |
public class LegacyTaglet implements Taglet {
|
|
49 |
|
|
50 |
private com.sun.tools.doclets.Taglet legacyTaglet;
|
|
51 |
|
|
52 |
public LegacyTaglet(com.sun.tools.doclets.Taglet t) {
|
|
53 |
legacyTaglet = t;
|
|
54 |
}
|
|
55 |
|
|
56 |
/**
|
|
57 |
* {@inheritDoc}
|
|
58 |
*/
|
|
59 |
public boolean inField() {
|
|
60 |
return legacyTaglet.isInlineTag() || legacyTaglet.inField();
|
|
61 |
}
|
|
62 |
|
|
63 |
/**
|
|
64 |
* {@inheritDoc}
|
|
65 |
*/
|
|
66 |
public boolean inConstructor() {
|
|
67 |
return legacyTaglet.isInlineTag() || legacyTaglet.inConstructor();
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
* {@inheritDoc}
|
|
72 |
*/
|
|
73 |
public boolean inMethod() {
|
|
74 |
return legacyTaglet.isInlineTag() || legacyTaglet.inMethod();
|
|
75 |
}
|
|
76 |
|
|
77 |
/**
|
|
78 |
* {@inheritDoc}
|
|
79 |
*/
|
|
80 |
public boolean inOverview() {
|
|
81 |
return legacyTaglet.isInlineTag() || legacyTaglet.inOverview();
|
|
82 |
}
|
|
83 |
|
|
84 |
/**
|
|
85 |
* {@inheritDoc}
|
|
86 |
*/
|
|
87 |
public boolean inPackage() {
|
|
88 |
return legacyTaglet.isInlineTag() || legacyTaglet.inPackage();
|
|
89 |
}
|
|
90 |
|
|
91 |
/**
|
|
92 |
* {@inheritDoc}
|
|
93 |
*/
|
|
94 |
public boolean inType() {
|
|
95 |
return legacyTaglet.isInlineTag() || legacyTaglet.inType();
|
|
96 |
}
|
|
97 |
|
|
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 |
}
|
|
107 |
|
|
108 |
/**
|
|
109 |
* {@inheritDoc}
|
|
110 |
*/
|
|
111 |
public String getName() {
|
|
112 |
return legacyTaglet.getName();
|
|
113 |
}
|
|
114 |
|
|
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 |
}
|
|
124 |
|
|
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 |
}
|