author | jjg |
Fri, 27 May 2016 13:06:58 -0700 | |
changeset 38617 | d93a7f64e231 |
parent 25874 | 83c19f00452c |
child 44878 | 9dd9cf7919ff |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
2 |
* Copyright (c) 1998, 2014, 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.javadoc; |
|
27 |
||
28 |
import java.text.BreakIterator; |
|
29 |
import java.util.Locale; |
|
30 |
||
31 |
/** |
|
32 |
* Represents a simple documentation tag, such as @since, @author, @version. |
|
33 |
* Given a tag (e.g. "@since 1.2"), holds tag name (e.g. "@since") |
|
34 |
* and tag text (e.g. "1.2"). Tags with structure or which require |
|
35 |
* special processing are handled by subclasses such as ParamTag |
|
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
36 |
* (for @param), SeeTag (for @see and {@link}), and ThrowsTag |
10 | 37 |
* (for @throws). |
38 |
* |
|
39 |
* @author Robert Field |
|
40 |
* @author Atul M Dambalkar |
|
41 |
* @see SeeTag |
|
42 |
* @see ParamTag |
|
43 |
* @see ThrowsTag |
|
44 |
* @see SerialFieldTag |
|
45 |
* @see Doc#tags() |
|
46 |
* |
|
38617 | 47 |
* @deprecated |
48 |
* The declarations in this package have been superseded by those |
|
49 |
* in the package {@code jdk.javadoc.doclet}. |
|
50 |
* For more information, see the <i>Migration Guide</i> in the documentation for that package. |
|
10 | 51 |
*/ |
38617 | 52 |
@Deprecated |
10 | 53 |
public interface Tag { |
54 |
||
55 |
/** |
|
56 |
* Return the name of this tag. The name is the string |
|
57 |
* starting with "@" that is used in a doc comment, such as |
|
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
58 |
* {@code @return}. For inline tags, such as |
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
59 |
* {@code {@link}}, the curly brackets |
10 | 60 |
* are not part of the name, so in this example the name |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
61 |
* would be simply {@code @link}. |
18384 | 62 |
* |
63 |
* @return the name of this tag |
|
10 | 64 |
*/ |
65 |
String name(); |
|
66 |
||
67 |
/** |
|
68 |
* Return the containing {@link Doc} of this Tag element. |
|
18384 | 69 |
* |
70 |
* @return the containing {@link Doc} of this Tag element |
|
10 | 71 |
*/ |
72 |
Doc holder(); |
|
73 |
||
74 |
/** |
|
75 |
* Return the kind of this tag. |
|
18384 | 76 |
* For most tags, |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
77 |
* {@code kind() == name()}; |
10 | 78 |
* the following table lists those cases where there is more |
79 |
* than one tag of a given kind: |
|
21490 | 80 |
* |
18384 | 81 |
* <table border="1" cellpadding="4" cellspacing="0" summary="related tags"> |
82 |
* <tr><th>{@code kind() }</th> <th>{@code name() }</th></tr> |
|
83 |
* <tr><td>{@code @throws }</td> <td>{@code @throws }</td></tr> |
|
84 |
* <tr><td>{@code @throws }</td> <td>{@code @exception }</td></tr> |
|
85 |
* <tr><td>{@code @see }</td> <td>{@code @see }</td></tr> |
|
86 |
* <tr><td>{@code @see }</td> <td>{@code @link }</td></tr> |
|
87 |
* <tr><td>{@code @see }</td> <td>{@code @linkplain }</td></tr> |
|
88 |
* <tr><td>{@code @serial }</td> <td>{@code @serial }</td></tr> |
|
89 |
* <tr><td>{@code @serial }</td> <td>{@code @serialData }</td></tr> |
|
10 | 90 |
* </table> |
18384 | 91 |
* |
92 |
* @return the kind of this tag. |
|
10 | 93 |
*/ |
94 |
String kind(); |
|
95 |
||
96 |
/** |
|
18384 | 97 |
* Return the text of this tag, that is, the portion beyond tag name. |
98 |
* |
|
99 |
* @return the text of this tag |
|
10 | 100 |
*/ |
101 |
String text(); |
|
102 |
||
103 |
/** |
|
104 |
* Convert this object to a string. |
|
105 |
*/ |
|
106 |
String toString(); |
|
107 |
||
108 |
/** |
|
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
109 |
* For a documentation comment with embedded {@code {@link}} |
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
110 |
* tags, return an array of {@code Tag} objects. The entire |
10 | 111 |
* doc comment is broken down into strings separated by |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
112 |
* {@code {@link}} tags, where each successive element |
10 | 113 |
* of the array represents either a string or |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
114 |
* {@code {@link}} tag, in order, from start to end. |
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
115 |
* Each string is represented by a {@code Tag} object of |
10 | 116 |
* name "Text", where {@link #text()} returns the string. Each |
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
117 |
* {@code {@link}} tag is represented by a |
10 | 118 |
* {@link SeeTag} of name "@link" and kind "@see". |
119 |
* For example, given the following comment |
|
120 |
* tag: |
|
121 |
* <p> |
|
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
122 |
* {@code This is a {@link Doc commentlabel} example.} |
10 | 123 |
* <p> |
124 |
* return an array of Tag objects: |
|
125 |
* <ul> |
|
126 |
* <li> tags[0] is a {@link Tag} with name "Text" and text consisting |
|
127 |
* of "This is a " |
|
128 |
* <li> tags[1] is a {@link SeeTag} with name "@link", referenced |
|
23137
209daac13c8b
8035878: javadoc tool documentation should be using {@code ..} specifier
jjg
parents:
21490
diff
changeset
|
129 |
* class {@code Doc} and label "commentlabel" |
10 | 130 |
* <li> tags[2] is a {@link Tag} with name "Text" and text consisting |
131 |
* of " example." |
|
132 |
* </ul> |
|
133 |
* |
|
134 |
* @return Tag[] array of tags |
|
135 |
* @see ParamTag |
|
136 |
* @see ThrowsTag |
|
137 |
*/ |
|
138 |
Tag[] inlineTags(); |
|
139 |
||
140 |
/** |
|
141 |
* Return the first sentence of the comment as an array of tags. |
|
142 |
* Includes inline tags |
|
13844 | 143 |
* (i.e. {@link <i>reference</i>} tags) but not |
10 | 144 |
* block tags. |
145 |
* Each section of plain text is represented as a {@link Tag} |
|
146 |
* of kind "Text". |
|
147 |
* Inline tags are represented as a {@link SeeTag} of kind "@link". |
|
148 |
* If the locale is English language, the first sentence is |
|
149 |
* determined by the rules described in the Java Language |
|
150 |
* Specification (first version): "This sentence ends |
|
151 |
* at the first period that is followed by a blank, tab, or |
|
152 |
* line terminator or at the first tagline.", in |
|
153 |
* addition a line will be terminated by paragraph and |
|
154 |
* section terminating HTML tags: <p> </p> <h1> |
|
155 |
* <h2> <h3> <h4> <h5> <h6> |
|
156 |
* <hr> <pre> or </pre>. |
|
157 |
* If the locale is not English, the sentence end will be |
|
158 |
* determined by |
|
159 |
* {@link BreakIterator#getSentenceInstance(Locale)}. |
|
160 |
* |
|
161 |
* @return an array of {@link Tag} objects representing the |
|
162 |
* first sentence of the comment |
|
163 |
*/ |
|
164 |
Tag[] firstSentenceTags(); |
|
165 |
||
166 |
/** |
|
167 |
* Return the source position of this tag. |
|
168 |
* @return the source position of this tag. |
|
169 |
*/ |
|
170 |
public SourcePosition position(); |
|
171 |
} |