1 /* Doc.java -- Model of an item to document.
2    Copyright (C) 1999, 2012 Free Software Foundation, Inc.
3 
4 This file is part of GNU Classpath.
5 
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10 
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
20 
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library.  Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
25 
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module.  An independent module is a module which is not derived from
33 or based on this library.  If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so.  If you do not wish to do so, delete this
36 exception statement from your version. */
37 
38 
39 package com.sun.javadoc;
40 
41 /**
42   * This interface is the super-interface of all items that can have
43   * Javadoc comments associated with them.
44   */
45 public interface Doc extends java.io.Serializable, Comparable<Doc>
46 {
47 
48 /**
49   * This method returns the text of the comment for this item, with all
50   * tags stripped.
51   *
52   * @return The comment text for this item.
53   */
54 public abstract String
commentText()55 commentText();
56 
57 /*************************************************************************/
58 
59 /**
60   * This method returns an array of all the tags in this item.
61   *
62   * @return An array of tags for this item.
63   */
64 public abstract Tag[]
tags()65 tags();
66 
67 /*************************************************************************/
68 
69 /**
70   * This method returns an array of all the tags of the specified type
71   * in this item.
72   *
73   * @param tagtype The name of the tag type to return.
74   *
75   * @return A list of all tags of the specified type.
76   */
77 public abstract Tag[]
tags(String tagtype)78 tags(String tagtype);
79 
80 /*************************************************************************/
81 
82 /**
83   * This method returns an array of all tags of the "@see" type.
84   *
85   * @return An array of tags of the "@see" type
86   */
87 public abstract SeeTag[]
seeTags()88 seeTags();
89 
90 /*************************************************************************/
91 
92 /**
93   * This method returns the comment text as an array of tags.  This will
94   * include any inline tags, but no regular tags.  Regular text is returned
95   * as a type of <code>Text</code>.  Inline "@see" tags are returned as
96   * type <code>SeeTag</code>.
97   *
98   * @return The comment text as tags.
99   */
100 public abstract Tag[]
inlineTags()101 inlineTags();
102 
103 /*************************************************************************/
104 
105 /**
106   * This method returns the first sentence of the comment text as an array
107   * of tags.  This will include any inline tags, but no regular tags.
108   * Regular text is returned as a type of <code>Text</code>. Inline "@see"
109   * tags are returned as type <code>SeeTag</code>.
110   *
111   * @return An array of tags representing the first sentence of the comment
112   * text.
113   */
114 public abstract Tag[]
firstSentenceTags()115 firstSentenceTags();
116 
117 /*************************************************************************/
118 
119 /**
120   * This method returns the text of the comment in an unprocessed format.
121   * Any Javadoc tags will remain as written in the text.
122   *
123   * @return The unprocessed comment text.
124   */
125 public abstract String
getRawCommentText()126 getRawCommentText();
127 
128 /*************************************************************************/
129 
130 /**
131   * This method sets the unprocessed comment text for this item.
132   *
133   * @param rawtext The unprocessed comment text for this itme.
134   */
135 public abstract void
setRawCommentText(String rawtext)136 setRawCommentText(String rawtext);
137 
138 /*************************************************************************/
139 
140 /**
141   * This method returns the name of this item.
142   *
143   * @return The name of this item.
144   */
145 public abstract String
name()146 name();
147 
148 /*************************************************************************/
149 
150 /**
151   * This method tests whether or not this item is a field.
152   *
153   * @return <code>true</code> if this item is a field, <code>false</code>
154   * otherwise.
155   */
156 public abstract boolean
isField()157 isField();
158 
159 /*************************************************************************/
160 
161 /**
162   * This method tests whether or not this item is a method.
163   *
164   * @return <code>true</code> if this item is a method, <code>false</code>
165   * otherwise.
166   */
167 public abstract boolean
isMethod()168 isMethod();
169 
170 /*************************************************************************/
171 
172 /**
173   * This method tests whether or not this item is a constructor.
174   *
175   * @return <code>true</code> if this item is a constructor,
176   * <code>false</code> otherwise.
177   */
178 public abstract boolean
isConstructor()179 isConstructor();
180 
181 /*************************************************************************/
182 
183 /**
184   * This method tests whether or not this item is an interface.
185   *
186   * @return <code>true</code> if this item is an interface,
187   * <code>false</code> otherwise.
188   */
189 public abstract boolean
isInterface()190 isInterface();
191 
192 /*************************************************************************/
193 
194 /**
195   * This method tests whether or not this item is an exception.
196   *
197   * @return <code>true</code> if this item is an exception,
198   * <code>false</code> otherwise.
199   */
200 public abstract boolean
isException()201 isException();
202 
203 /*************************************************************************/
204 
205 /**
206   * This method tests whether or not this item is an error.
207   *
208   * @return <code>true</code> if this item is an error,
209   * <code>false</code> otherwise.
210   */
211 public abstract boolean
isError()212 isError();
213 
214 /*************************************************************************/
215 
216 /**
217   * This method tests whether or not this item is a class.  Interfaces
218   * do not count as classes.
219   *
220   * @return <code>true</code> if this item is a class,
221   * <code>false</code> otherwise.
222   */
223 public abstract boolean
isClass()224 isClass();
225 
226 /*************************************************************************/
227 
228 /**
229   * This method tests whether or not this item is an ordinary class.  An
230   * ordinary class is a class that is not an exception or an error.
231   * Interfaces also do not count because they are not considered classes at
232   * all.
233   *
234   * @return <code>true</code> if this item is an ordinary class,
235   * <code>false</code> otherwise.
236   */
237 public abstract boolean
isOrdinaryClass()238 isOrdinaryClass();
239 
240 /*************************************************************************/
241 
242 /**
243   * This method tests whether or not this item is part of the active set,
244   * whatever that is.
245   *
246   * @return <code>true</code> if this item is part of the active set,
247   * <code>false</code> otherwise.
248   */
249 public abstract boolean
isIncluded()250 isIncluded();
251 
252 /*************************************************************************/
253 
254 /**
255   * This method returns the location of the item within the Java
256   * source code.
257   *
258   * @return an object describing the file, line and column where this
259   * item is defined.
260   */
261 public abstract SourcePosition
position()262 position();
263 
264 } // interface Doc
265