001/////////////////////////////////////////////////////////////////////////////////////////////// 002// checkstyle: Checks Java source code and other text files for adherence to a set of rules. 003// Copyright (C) 2001-2025 the original author or authors. 004// 005// This library is free software; you can redistribute it and/or 006// modify it under the terms of the GNU Lesser General Public 007// License as published by the Free Software Foundation; either 008// version 2.1 of the License, or (at your option) any later version. 009// 010// This library is distributed in the hope that it will be useful, 011// but WITHOUT ANY WARRANTY; without even the implied warranty of 012// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013// Lesser General Public License for more details. 014// 015// You should have received a copy of the GNU Lesser General Public 016// License along with this library; if not, write to the Free Software 017// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018/////////////////////////////////////////////////////////////////////////////////////////////// 019 020package com.puppycrawl.tools.checkstyle.api; 021 022import com.puppycrawl.tools.checkstyle.grammar.javadoc.JavadocCommentsLexer; 023 024/** 025 * Contains the constants for all the tokens contained in the Abstract 026 * Syntax Tree for the javadoc grammar. 027 * 028 * @see <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javadoc.html"> 029 * javadoc - The Java API Documentation Generator</a> 030 */ 031public final class JavadocCommentsTokenTypes { 032 033 /** 034 * Root node of any Javadoc comment. 035 * 036 * <p><b>Tree for example:</b></p> 037 * <pre>{@code 038 * JAVADOC_CONTENT -> JAVADOC_CONTENT 039 * |--LEADING_ASTERISK -> * 040 * |--NEWLINE -> \n 041 * |--LEADING_ASTERISK -> * 042 * |--NEWLINE -> \n 043 * |--LEADING_ASTERISK -> * 044 * `--NEWLINE -> \n 045 * }</pre> 046 */ 047 public static final int JAVADOC_CONTENT = JavadocCommentsLexer.JAVADOC; 048 049 /** 050 * Leading asterisk used to format Javadoc lines. 051 */ 052 public static final int LEADING_ASTERISK = JavadocCommentsLexer.LEADING_ASTERISK; 053 054 /** 055 * Newline character in a Javadoc comment. 056 */ 057 public static final int NEWLINE = JavadocCommentsLexer.NEWLINE; 058 059 /** 060 * Plain text content within a Javadoc comment. 061 */ 062 public static final int TEXT = JavadocCommentsLexer.TEXT; 063 064 // Block tags 065 066 /** 067 * General block tag (e.g. {@code @param}, {@code @return}). 068 */ 069 public static final int JAVADOC_BLOCK_TAG = JavadocCommentsLexer.JAVADOC_BLOCK_TAG; 070 071 /** 072 * At-sign {@code @} that starts a block tag. 073 */ 074 public static final int AT_SIGN = JavadocCommentsLexer.AT_SIGN; 075 076 /** 077 * {@code @author} block tag. 078 */ 079 public static final int AUTHOR_BLOCK_TAG = JavadocCommentsLexer.AUTHOR_BLOCK_TAG; 080 081 /** 082 * {@code @deprecated} block tag. 083 */ 084 public static final int DEPRECATED_BLOCK_TAG = JavadocCommentsLexer.DEPRECATED_BLOCK_TAG; 085 086 /** 087 * {@code @param} Javadoc block tag. 088 * 089 * <p>Such Javadoc tag can have two children:</p> 090 * <ol> 091 * <li>{@link #PARAMETER_NAME}</li> 092 * <li>{@link #DESCRIPTION}</li> 093 * </ol> 094 * 095 * <p><b>Example:</b></p> 096 * <pre>{@code * @param value The parameter of method.}</pre> 097 * <b>Tree:</b> 098 * <pre>{@code 099 * JAVADOC_BLOCK_TAG -> JAVADOC_BLOCK_TAG 100 * `--PARAM_BLOCK_TAG -> PARAM_BLOCK_TAG 101 * |--AT_SIGN -> @ 102 * |--TAG_NAME -> param 103 * |--TEXT -> 104 * |--PARAMETER_NAME -> value 105 * `--DESCRIPTION -> DESCRIPTION 106 * `--TEXT -> The parameter of method. 107 * }</pre> 108 * 109 * @see #JAVADOC_BLOCK_TAG 110 */ 111 public static final int PARAM_BLOCK_TAG = JavadocCommentsLexer.PARAM_BLOCK_TAG; 112 113 /** 114 * {@code @return} block tag. 115 */ 116 public static final int RETURN_BLOCK_TAG = JavadocCommentsLexer.RETURN_BLOCK_TAG; 117 118 /** 119 * {@code @throws} block tag. 120 */ 121 public static final int THROWS_BLOCK_TAG = JavadocCommentsLexer.THROWS_BLOCK_TAG; 122 123 /** 124 * {@code @exception} block tag. 125 */ 126 public static final int EXCEPTION_BLOCK_TAG = JavadocCommentsLexer.EXCEPTION_BLOCK_TAG; 127 128 /** 129 * {@code @since} block tag. 130 */ 131 public static final int SINCE_BLOCK_TAG = JavadocCommentsLexer.SINCE_BLOCK_TAG; 132 133 /** 134 * {@code @version} block tag. 135 */ 136 public static final int VERSION_BLOCK_TAG = JavadocCommentsLexer.VERSION_BLOCK_TAG; 137 138 /** 139 * {@code @see} block tag. 140 */ 141 public static final int SEE_BLOCK_TAG = JavadocCommentsLexer.SEE_BLOCK_TAG; 142 143 /** 144 * {@code @hidden} block tag. 145 */ 146 public static final int HIDDEN_BLOCK_TAG = JavadocCommentsLexer.HIDDEN_BLOCK_TAG; 147 148 /** 149 * {@code @uses} block tag. 150 */ 151 public static final int USES_BLOCK_TAG = JavadocCommentsLexer.USES_BLOCK_TAG; 152 153 /** 154 * {@code @provides} block tag. 155 */ 156 public static final int PROVIDES_BLOCK_TAG = JavadocCommentsLexer.PROVIDES_BLOCK_TAG; 157 158 /** 159 * {@code @serial} block tag. 160 */ 161 public static final int SERIAL_BLOCK_TAG = JavadocCommentsLexer.SERIAL_BLOCK_TAG; 162 163 /** 164 * {@code @serialData} block tag. 165 */ 166 public static final int SERIAL_DATA_BLOCK_TAG = JavadocCommentsLexer.SERIAL_DATA_BLOCK_TAG; 167 168 /** 169 * {@code @serialField} block tag. 170 */ 171 public static final int SERIAL_FIELD_BLOCK_TAG = JavadocCommentsLexer.SERIAL_FIELD_BLOCK_TAG; 172 173 /** 174 * Custom or unrecognized block tag. 175 */ 176 public static final int CUSTOM_BLOCK_TAG = JavadocCommentsLexer.CUSTOM_BLOCK_TAG; 177 178 // Inline tags 179 180 /** 181 * General inline tag (e.g. {@code @link}). 182 */ 183 public static final int JAVADOC_INLINE_TAG = JavadocCommentsLexer.JAVADOC_INLINE_TAG; 184 185 /** 186 * Start of an inline tag <code>{</code>. 187 */ 188 public static final int JAVADOC_INLINE_TAG_START = 189 JavadocCommentsLexer.JAVADOC_INLINE_TAG_START; 190 191 /** 192 * End of an inline tag <code>}</code>. 193 */ 194 public static final int JAVADOC_INLINE_TAG_END = JavadocCommentsLexer.JAVADOC_INLINE_TAG_END; 195 196 /** 197 * {@code {@code}} inline tag. 198 */ 199 public static final int CODE_INLINE_TAG = JavadocCommentsLexer.CODE_INLINE_TAG; 200 201 /** 202 * {@code {@link}} inline tag. 203 */ 204 public static final int LINK_INLINE_TAG = JavadocCommentsLexer.LINK_INLINE_TAG; 205 206 /** 207 * {@code {@linkplain}} inline tag. 208 */ 209 public static final int LINKPLAIN_INLINE_TAG = JavadocCommentsLexer.LINKPLAIN_INLINE_TAG; 210 211 /** 212 * {@code {@value}} inline tag. 213 */ 214 public static final int VALUE_INLINE_TAG = JavadocCommentsLexer.VALUE_INLINE_TAG; 215 216 /** 217 * {@code {@summary}} inline tag. 218 */ 219 public static final int SUMMARY_INLINE_TAG = JavadocCommentsLexer.SUMMARY_INLINE_TAG; 220 221 /** 222 * {@code {@inheritDoc}} inline tag. 223 */ 224 public static final int INHERIT_DOC_INLINE_TAG = JavadocCommentsLexer.INHERIT_DOC_INLINE_TAG; 225 226 /** 227 * {@code {@systemProperty}} inline tag. 228 */ 229 public static final int SYSTEM_PROPERTY_INLINE_TAG = 230 JavadocCommentsLexer.SYSTEM_PROPERTY_INLINE_TAG; 231 232 /** 233 * {@code {@literal}} inline tag. 234 */ 235 public static final int LITERAL_INLINE_TAG = JavadocCommentsLexer.LITERAL_INLINE_TAG; 236 237 /** 238 * {@code {@return}} inline tag. 239 */ 240 public static final int RETURN_INLINE_TAG = JavadocCommentsLexer.RETURN_INLINE_TAG; 241 242 /** 243 * {@code {@index}} inline tag. 244 */ 245 public static final int INDEX_INLINE_TAG = JavadocCommentsLexer.INDEX_INLINE_TAG; 246 247 /** 248 * {@code @snippet} inline tag. 249 */ 250 public static final int SNIPPET_INLINE_TAG = JavadocCommentsLexer.SNIPPET_INLINE_TAG; 251 252 /** 253 * Custom or unrecognized inline tag. 254 */ 255 public static final int CUSTOM_INLINE_TAG = JavadocCommentsLexer.CUSTOM_INLINE_TAG; 256 257 // Components 258 259 /** 260 * Identifier token. 261 */ 262 public static final int IDENTIFIER = JavadocCommentsLexer.IDENTIFIER; 263 264 /** 265 * Hash symbol {@code #} used in references. 266 */ 267 public static final int HASH = JavadocCommentsLexer.HASH; 268 269 /** 270 * Left parenthesis {@code ( }. 271 */ 272 public static final int LPAREN = JavadocCommentsLexer.LPAREN; 273 274 /** 275 * Right parenthesis {@code ) }. 276 */ 277 public static final int RPAREN = JavadocCommentsLexer.RPAREN; 278 279 /** 280 * Comma symbol {@code , }. 281 */ 282 public static final int COMMA = JavadocCommentsLexer.COMMA; 283 284 /** 285 * Slash symbol {@code / }. 286 */ 287 public static final int SLASH = JavadocCommentsLexer.SLASH; 288 289 /** 290 * Question mark symbol {@code ? }. 291 */ 292 public static final int QUESTION = JavadocCommentsLexer.QUESTION; 293 294 /** 295 * Less-than symbol {@code < }. 296 */ 297 public static final int LT = JavadocCommentsLexer.LT; 298 299 /** 300 * Greater-than symbol {@code > }. 301 */ 302 public static final int GT = JavadocCommentsLexer.GT; 303 304 /** 305 * Keyword {@code extends} in type parameters. 306 */ 307 public static final int EXTENDS = JavadocCommentsLexer.EXTENDS; 308 309 /** 310 * Keyword {@code super} in type parameters. 311 */ 312 public static final int SUPER = JavadocCommentsLexer.SUPER; 313 314 /** 315 * Parameter type reference. 316 */ 317 public static final int PARAMETER_TYPE = JavadocCommentsLexer.PARAMETER_TYPE; 318 319 /** 320 * General reference within Javadoc. 321 */ 322 public static final int REFERENCE = JavadocCommentsLexer.REFERENCE; 323 324 /** 325 * Type name reference. 326 */ 327 public static final int TYPE_NAME = JavadocCommentsLexer.TYPE_NAME; 328 329 /** 330 * Member reference (e.g. method or field). 331 */ 332 public static final int MEMBER_REFERENCE = JavadocCommentsLexer.MEMBER_REFERENCE; 333 334 /** 335 * List of parameter types in a reference. 336 */ 337 public static final int PARAMETER_TYPE_LIST = JavadocCommentsLexer.PARAMETER_TYPE_LIST; 338 339 /** 340 * Type arguments in generics. 341 */ 342 public static final int TYPE_ARGUMENTS = JavadocCommentsLexer.TYPE_ARGUMENTS; 343 344 /** 345 * Single type argument in generics. 346 */ 347 public static final int TYPE_ARGUMENT = JavadocCommentsLexer.TYPE_ARGUMENT; 348 349 /** 350 * Description part of a Javadoc tag. 351 */ 352 public static final int DESCRIPTION = JavadocCommentsLexer.DESCRIPTION; 353 354 /** 355 * Format specifier inside Javadoc content. 356 */ 357 public static final int FORMAT_SPECIFIER = JavadocCommentsLexer.FORMAT_SPECIFIER; 358 359 /** 360 * Attribute name in a {@code @snippet}. 361 */ 362 public static final int SNIPPET_ATTR_NAME = JavadocCommentsLexer.SNIPPET_ATTR_NAME; 363 364 /** 365 * Equals sign {@code = }. 366 */ 367 public static final int EQUALS = JavadocCommentsLexer.EQUALS; 368 369 /** 370 * Value assigned to an attribute. 371 */ 372 public static final int ATTRIBUTE_VALUE = JavadocCommentsLexer.ATTRIBUTE_VALUE; 373 374 /** 375 * Colon symbol {@code : }. 376 */ 377 public static final int COLON = JavadocCommentsLexer.COLON; 378 379 /** 380 * Term used in {@code {@index}} tag. 381 */ 382 public static final int INDEX_TERM = JavadocCommentsLexer.INDEX_TERM; 383 384 /** 385 * Single snippet attribute. 386 */ 387 public static final int SNIPPET_ATTRIBUTE = JavadocCommentsLexer.SNIPPET_ATTRIBUTE; 388 389 /** 390 * Collection of snippet attributes. 391 */ 392 public static final int SNIPPET_ATTRIBUTES = JavadocCommentsLexer.SNIPPET_ATTRIBUTES; 393 394 /** 395 * Body content of a {@code @snippet}. 396 */ 397 public static final int SNIPPET_BODY = JavadocCommentsLexer.SNIPPET_BODY; 398 399 /** 400 * Field type reference. 401 */ 402 public static final int FIELD_TYPE = JavadocCommentsLexer.FIELD_TYPE; 403 404 /** 405 * Parameter name reference. 406 */ 407 public static final int PARAMETER_NAME = JavadocCommentsLexer.PARAMETER_NAME; 408 409 /** 410 * String literal inside Javadoc. 411 */ 412 public static final int STRING_LITERAL = JavadocCommentsLexer.STRING_LITERAL; 413 414 // HTML 415 416 /** 417 * General HTML element. 418 */ 419 public static final int HTML_ELEMENT = JavadocCommentsLexer.HTML_ELEMENT; 420 421 /** 422 * Void HTML element (self-closing). 423 */ 424 public static final int VOID_ELEMENT = JavadocCommentsLexer.VOID_ELEMENT; 425 426 /** 427 * Content inside an HTML element. 428 */ 429 public static final int HTML_CONTENT = JavadocCommentsLexer.HTML_CONTENT; 430 431 /** 432 * Single HTML attribute. 433 */ 434 public static final int HTML_ATTRIBUTE = JavadocCommentsLexer.HTML_ATTRIBUTE; 435 436 /** 437 * List of HTML attributes. 438 */ 439 public static final int HTML_ATTRIBUTES = JavadocCommentsLexer.HTML_ATTRIBUTES; 440 441 /** 442 * Start of an HTML tag. 443 */ 444 public static final int HTML_TAG_START = JavadocCommentsLexer.HTML_TAG_START; 445 446 /** 447 * End of an HTML tag. 448 */ 449 public static final int HTML_TAG_END = JavadocCommentsLexer.HTML_TAG_END; 450 451 /** 452 * Opening tag delimiter {@code < }. 453 */ 454 public static final int TAG_OPEN = JavadocCommentsLexer.TAG_OPEN; 455 456 /** 457 * HTML tag name. 458 */ 459 public static final int TAG_NAME = JavadocCommentsLexer.TAG_NAME; 460 461 /** 462 * Closing tag delimiter {@code > }. 463 */ 464 public static final int TAG_CLOSE = JavadocCommentsLexer.TAG_CLOSE; 465 466 /** 467 * Self-closing tag delimiter {@code /> }. 468 */ 469 public static final int TAG_SLASH_CLOSE = JavadocCommentsLexer.TAG_SLASH_CLOSE; 470 471 /** 472 * Slash symbol inside a closing tag. 473 */ 474 public static final int TAG_SLASH = JavadocCommentsLexer.TAG_SLASH; 475 476 /** 477 * Attribute name inside an HTML tag. 478 */ 479 public static final int TAG_ATTR_NAME = JavadocCommentsLexer.TAG_ATTR_NAME; 480 481 /** 482 * Full HTML comment. 483 */ 484 public static final int HTML_COMMENT = JavadocCommentsLexer.HTML_COMMENT; 485 486 /** 487 * Opening part of an HTML comment. 488 */ 489 public static final int HTML_COMMENT_START = JavadocCommentsLexer.HTML_COMMENT_START; 490 491 /** 492 * Closing part of an HTML comment. 493 */ 494 public static final int HTML_COMMENT_END = JavadocCommentsLexer.HTML_COMMENT_END; 495 496 /** 497 * Content inside an HTML comment. 498 */ 499 public static final int HTML_COMMENT_CONTENT = JavadocCommentsLexer.HTML_COMMENT_CONTENT; 500 501 /** Empty private constructor of the current class. */ 502 private JavadocCommentsTokenTypes() { 503 } 504}