aboutsummaryrefslogtreecommitdiff
path: root/src/xdocs/config_annotation.xml
blob: d3b98cefb9e3865597e01b747c09cbbd9fcef98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
<?xml version="1.0" encoding="UTF-8"?>

<document xmlns="http://maven.apache.org/XDOC/2.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">

  <head>
    <title>Annotations</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/>
    <script type="text/javascript" src="js/anchors.js"/>
    <script type="text/javascript" src="js/google-analytics.js"/>
    <link rel="icon" href="images/favicon.png" type="image/x-icon" />
    <link rel="shortcut icon" href="images/favicon.ico" type="image/ico" />
  </head>

  <body>
    <section name="Content">
      <macro name="toc">
        <param name="fromDepth" value="1"/>
        <param name="toDepth" value="1"/>
      </macro>
    </section>

    <section name="AnnotationLocation">
      <subsection name="Description">
        <p>
          Check location of annotation on language elements.
          By default, Check enforce to locate annotations immediately
          after documentation block and before target element, annotation should be located on separate line from target element.
        </p>
        <p>
          Attention: Annotations among modifiers are ignored (looks like false-negative)
          as there might be a problem with annotations for return types <source>public @Nullable Long getStartTimeOrNull() { ... }</source>
          Such annotations are better to keep close to type.
          Due to limitations Checkstyle can not examin target of annotation.
        </p>
        <p>
          Example:
        </p>
        <source>
@Override
@Nullable
public String getNameIfPresent() { ... }
        </source>
      </subsection>

      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>allowSamelineMultipleAnnotations</td>
            <td>To allow annotation to be located on the same line as target element.</td>
            <td><a href="property_types.html#boolean">Boolean</a></td>
           <td><code>false</code></td>
          </tr>
          <tr>
            <td>allowSamelineSingleParameterlessAnnotation</td>
            <td>To allow single prameterless annotation to be located on the same line as target element.</td>
            <td><a href="property_types.html#boolean">Boolean</a></td>
            <td><code>true</code></td>
          </tr>
          <tr>
            <td>allowSamelineParameterizedAnnotation</td>
            <td>To allow parameterized annotation to be located on the same line as target element.</td>
            <td><a href="property_types.html#boolean">Boolean</a></td>
            <td><code>false</code></td>
          </tr>
          <tr>
            <td>tokens</td>
            <td>tokens to check</td>
            <td>subset of tokens
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CLASS_DEF">CLASS_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INTERFACE_DEF">INTERFACE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_DEF">ENUM_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#VARIABLE_DEF">VARIABLE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PARAMETER_DEF">PARAMETER_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_DEF">ANNOTATION_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_THROWS">LITERAL_THROWS</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#IMPLEMENTS_CLAUSE">IMPLEMENTS_CLAUSE</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPE_ARGUMENT">TYPE_ARGUMENT</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_NEW">LITERAL_NEW</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DOT">DOT</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_FIELD_DEF">ANNOTATION_FIELD_DEF</a>.
            </td>
            <td>
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CLASS_DEF">CLASS_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INTERFACE_DEF">INTERFACE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_DEF">ENUM_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#VARIABLE_DEF">VARIABLE_DEF</a>.
            </td>
          </tr>
        </table>
      </subsection>

      <subsection name="Examples">
        <p>
          Example to allow single parameterless annotation on the same line
        </p>
        <source>
@Override public int hashCode() { ... }
        </source>
        <p>
          Use following configuration:
        </p>
        <source>
&lt;module name=&quot;AnnotationLocation&quot;&gt;
    &lt;property name=&quot;allowSamelineMultipleAnnotations&quot; value=&quot;false&quot;/&gt;
    &lt;property name=&quot;allowSamelineSingleParameterlessAnnotation&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;allowSamelineParameterizedAnnotation&quot; value=&quot;false&quot;/&gt;
&lt;/module&gt;
        </source>
        <p>
          Example to allow multiple parameterized annotations on the same line
        </p>
        <source>
@SuppressWarnings("deprecation") @Mock DataLoader loader;
        </source>
        <p>
          Use following configuration:
        </p>
        <source>
&lt;module name=&quot;AnnotationLocation&quot;&gt;
    &lt;property name=&quot;allowSamelineMultipleAnnotations&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;allowSamelineSingleParameterlessAnnotation&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;allowSamelineParameterizedAnnotation&quot; value=&quot;true&quot;/&gt;
&lt;/module&gt;
        </source>
        <p>
          Example to allow multiple parameterless annotations on the same line
        </p>
        <source>
@Partial @Mock DataLoader loader;
        </source>
        <p>
          Use following configuration:
        </p>
        <source>
&lt;module name=&quot;AnnotationLocation&quot;&gt;
    &lt;property name=&quot;allowSamelineMultipleAnnotations&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;allowSamelineSingleParameterlessAnnotation&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;allowSamelineParameterizedAnnotation&quot; value=&quot;false&quot;/&gt;
&lt;/module&gt;
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources+filename%3Agoogle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+AnnotationLocation">
            Google Style</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+AnnotationLocation">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.location%22">
            annotation.location</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.location.alone%22">
            annotation.location.alone</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="AnnotationUseStyle">
      <subsection name="Description">
        <p> This check controls the style with the usage of annotations.
        </p>
      </subsection>
      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>elementStyle</td>
            <td>
              <p>
                Defines the annotation element styles.
              </p>
            </td>
            <td>
              <a href="property_types.html#elementStyle">element style</a>
            </td>
            <td>
              <code>compact_no_array</code>
            </td>
          </tr>
          <tr>
            <td>closingParens</td>
            <td>
              Defines the policy for ending parenthesis.
            </td>
            <td>
              <a href="property_types.html#closingParens">closing parens</a>
            </td>
            <td>
              <code>never</code>
            </td>
          </tr>
          <tr>
            <td>trailingArrayComma</td>
            <td>
              Defines the policy for trailing comma in arrays.
            </td>
            <td>
              <a href="property_types.html#trailingArrayComma">trailing comma</a>
            </td>
            <td>
              <code>never</code>
            </td>
          </tr>
        </table>
      </subsection>
      <subsection name="Examples">
        <p> To configure the check:</p>
        <source> &lt;module name=&quot;AnnotationUseStyle&quot;/&gt;
        </source>

        <p>
          To configure the check to enforce an
          <code>expanded</code> style, with a
          trailing array comma set to <code>never</code>
          and always including the closing
          parenthesis.
        </p>
        <source>
&lt;module name=&quot;AnnotationUseStyle&quot;&gt;
    &lt;property name=&quot;elementStyle&quot; value=&quot;expanded&quot;/&gt;
    &lt;property name=&quot;trailingArrayComma&quot; value=&quot;never&quot;/&gt;
    &lt;property name=&quot;closingParens&quot; value=&quot;always&quot;/&gt;
&lt;/module&gt;
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+AnnotationUseStyle">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.incorrect.style%22">
            annotation.incorrect.style</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.parens.missing%22">
            annotation.parens.missing</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.parens.present%22">
            annotation.parens.present</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.trailing.comma.missing%22">
            annotation.trailing.comma.missing</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.trailing.comma.present%22">
            annotation.trailing.comma.present</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="MissingDeprecated">
      <subsection name="Description">
        <p> Verifies that both the java.lang.Deprecated annotation is
            present and the @deprecated Javadoc tag is present when
            either is present.</p>
      </subsection>
      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>skipNoJavadoc</td>
            <td>When this property is set to true check ignore cases
            when JavaDoc is missing, but still warns when JavaDoc is
            present but either @deprecated is missing from JavaDoc or
            @deprecated is missing from the element.
            </td>
            <td><a href="property_types.html#boolean">Boolean</a></td>
            <td>false</td>
          </tr>
        </table>
      </subsection>
      <subsection name="Examples">
        <p> To configure the check:</p>
        <source>
&lt;module name=&quot;MissingDeprecated&quot;/&gt;
        </source>
        <p> In addition you can configure this check with skipNoJavadoc option: </p>
        <source>
&lt;module name=&quot;MissingDeprecated&quot;&gt;
    &lt;property name="skipNoJavadoc" value="true" /&gt;
&lt;/module&gt;
        </source>
        <p>Examples of validating source code with skipNoJavadoc:</p>
        <source>
@deprecated
public static final int MY_CONST = 123456; // no violation

/** This javadoc is missing deprecated tag. */
@deprecated
public static final int COUNTER = 10; // violation as javadoc exists
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+MissingDeprecated">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.missing.deprecated%22">
            annotation.missing.deprecated</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22javadoc.duplicateTag%22">
            javadoc.duplicateTag</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22javadoc.missing%22">
            javadoc.missing</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="MissingOverride">
      <subsection name="Description">
        <p> Verifies that the java.lang.Override annotation is present
          when the {@inheritDoc} javadoc tag is present.</p>
      </subsection>
      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>javaFiveCompatibility</td>
            <td>
              When this property is true this check will only check
              classes, interfaces, etc. that do not contain the extends
              or implements keyword or are not anonymous classes. This
              means it only checks methods overridden from
              <code>java.lang.Object</code>
              <b>Java 5 Compatibility mode severely limits this
                check. It is recommended to only use it on Java 5 source </b>
            </td>
            <td>
              <a href="property_types.html#boolean">Boolean</a>
            </td>
            <td>
              <code>false</code>
            </td>
          </tr>
        </table>
      </subsection>
      <subsection name="Examples">
        <p> To configure the check:</p>
        <source> &lt;module name=&quot;MissingOverride&quot;/&gt;
        </source>

        <p>
          To configure the check for the <code>javaFiveCompatibility</code>
          mode:
        </p>
        <source>
   &lt;module name=&quot;MissingOverride&quot;&gt;
      &lt;property name=&quot;javaFiveCompatibility&quot;
          value=&quot;true&quot;/&gt;
   &lt;/module&gt;
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+MissingOverride">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.missing.override%22">
            annotation.missing.override</a>
          </li>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22tag.not.valid.on%22">
            tag.not.valid.on</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="PackageAnnotation">
      <subsection name="Description">
        <p>  This check makes sure that all package annotations are in the
             package-info.java file.
        </p>
        <p>
             According to the Java Language Specification.
        </p>

        <p>
            The JLS does not enforce the placement of package annotations.
            This placement may vary based on implementation. The JLS
            does highly recommend that all package annotations are
            placed in the package-info.java file.

            See <a
            href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4.1">
            Java Language Specification, section 7.4.1</a>.
        </p>
      </subsection>

      <subsection name="Examples">
        <p> To configure the check:</p>
        <source> &lt;module name=&quot;PackageAnnotation&quot;/&gt;
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+PackageAnnotation">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22annotation.package.location%22">
            annotation.package.location</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="SuppressWarnings">
      <subsection name="Description">
        <p> This check allows you to specify what warnings that
        SuppressWarnings is not allowed to suppress.
        You can also specify a list of TokenTypes that
        the configured warning(s) cannot be suppressed on.</p>

        <p>
        Limitations:  This check does not consider conditionals
        inside the SuppressWarnings annotation. <br/>
        For example: @SuppressWarnings((false) ? (true) ? "unchecked" : "foo" : "unused")
        According to the above example, the "unused" warning is being suppressed
        not the "unchecked" or "foo" warnings.  All of these warnings will be
        considered and matched against regardless of what the conditional
        evaluates to.
        <br/>
        The check also does not support code like <code>@SuppressWarnings("un" + "used")</code>,
        <code>@SuppressWarnings((String) "unused")</code> or
        <code>@SuppressWarnings({('u' + (char)'n') + (""+("used" + (String)"")),})</code>.
        </p>
      </subsection>
      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>format</td>
            <td>
               The warnings property is a regex pattern.  Any warning
               being suppressed matching this pattern will be flagged.
            </td>
            <td>
              <a href="property_types.html#regexp">regexp</a>
            </td>
            <td>
              <code>^$|^\s+$</code>
            </td>
          </tr>

          <tr>
            <td>tokens</td>
            <td>tokens to check</td>

            <td>
              subset of tokens
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CLASS_DEF">CLASS_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INTERFACE_DEF">INTERFACE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_DEF">ENUM_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_DEF">ANNOTATION_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_FIELD_DEF">ANNOTATION_FIELD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_CONSTANT_DEF">ENUM_CONSTANT_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PARAMETER_DEF">PARAMETER_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#VARIABLE_DEF">VARIABLE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>.
            </td>

            <td>
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CLASS_DEF">CLASS_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INTERFACE_DEF">INTERFACE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_DEF">ENUM_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_DEF">ANNOTATION_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ANNOTATION_FIELD_DEF">ANNOTATION_FIELD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_CONSTANT_DEF">ENUM_CONSTANT_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PARAMETER_DEF">PARAMETER_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#VARIABLE_DEF">VARIABLE_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
              <a href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>.
            </td>
          </tr>

        </table>
      </subsection>
      <subsection name="Examples">
        <p> To configure the check:</p>
        <source> &lt;module name=&quot;SuppressWarnings&quot;/&gt;
        </source>

        <p>
          To configure the check so that the "unchecked" and "unused"
          warnings cannot be suppressed on anything
          but variable and parameter declarations.
        </p>
        <source>
   &lt;module name=&quot;SuppressWarnings&quot;&gt;
      &lt;property name=&quot;format&quot;
          value=&quot;^unchecked$|^unused$&quot;/&gt;
      &lt;property name=&quot;tokens&quot;
          value=&quot;
          CLASS_DEF,INTERFACE_DEF,ENUM_DEF,
          ANNOTATION_DEF,ANNOTATION_FIELD_DEF,
          ENUM_CONSTANT_DEF,METHOD_DEF,CTOR_DEF
          &quot;/&gt;
   &lt;/module&gt;
        </source>
      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+SuppressWarnings">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fannotation+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22suppressed.warning.not.allowed%22">
            suppressed.warning.not.allowed</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks.annotation </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>
    </section>

    <section name="SuppressWarningsHolder">
      <subsection name="Description">
        <p>
          Maintains a set of check suppressions from
          <code>@SuppressWarnings</code> annotations. It allows to
          prevent Checkstyle from reporting errors from parts of code
          that were annotated with <code>@SuppressWarnings</code> and
          using name of the check to be excluded. You can also define
          aliases for check names that need to be suppressed.
         </p>
      </subsection>

      <subsection name="Properties">
        <table>
          <tr>
            <th>name</th>
            <th>description</th>
            <th>type</th>
            <th>default value</th>
          </tr>
          <tr>
            <td>aliasList</td>
            <td>Aliases for check names that can be used in code within <code>SuppressWarnings</code></td>
            <td><a href="property_types.html#stringSet">String Set</a> in a format of comma separated attribute=value entries.
            The attribute is the fully qualified name of the Check and value is its alias.</td>
            <td>null</td>
          </tr>
        </table>
      </subsection>

      <subsection name="Examples">
        <p>To prevent <code>FooCheck</code> errors from being reported write:</p>
        <source>
        @SuppressWarnings("foo") interface I { }
        @SuppressWarnings("foo") enum E { }
        @SuppressWarnings("foo") InputSuppressWarningsFilter() { }
        </source>
        <br />
        <p>Some real check examples:</p>
        <p>This will prevent from invocation of the MemberNameCheck:
          <source>
         @SuppressWarnings({"membername"})
         private int J;
           </source>
        </p>

        <p>You can also use a <code>checkstyle</code> prefix to prevent compiler from processing this annotations.
        For example this will prevent ConstantNameCheck
          <source>
            @SuppressWarnings("checkstyle:constantname")
            private static final int m = 0;
          </source>
        </p>

        <p>The general rule is that the argument of the <code>@SuppressWarnings</code> will be matched against class name of the checker in lower case
          and without <code>Check</code> suffix if present</p>
          <p>If <code>aliasList</code> property was provided you can use your own names e.g below code will work if there was provided a <code>ParameterNumberCheck=paramnum</code> in the <code>aliasList</code>
          <source>
            @SuppressWarnings("paramnum")
            public void needsLotsOfParameters(@SuppressWarnings("unused") int a,
              int b, int c, int d, int e, int f, int g, int h) {
              ...
            }
          </source>
      </p>

      <p>It is possible to suppress all the checkstyle warnings with the argument <code>"all"</code>:
          <source>
            @SuppressWarnings("all")
            public void someFunctionWithInvalidStyle() {
              //...
            }
          </source>
      </p>

      </subsection>

      <subsection name="Example of Usage">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Aconfig+filename%3Acheckstyle_checks.xml+repo%3Acheckstyle%2Fcheckstyle+SuppressWarningsHolder">
            Checkstyle Style</a>
          </li>
        </ul>
      </subsection>

      <subsection name="Error Messages">
        <ul>
          <li>
            <a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22suppress.warnings.invalid.target%22">
            suppress.warnings.invalid.target</a>
          </li>
        </ul>
        <p>
          All messages can be customized if the default message doesn't suite you.
          Please <a href="config.html#Custom_messages">see the documentation</a> to learn how to.
        </p>
      </subsection>

      <subsection name="Package">
        <p> com.puppycrawl.tools.checkstyle.checks </p>
      </subsection>

      <subsection name="Parent Module">
        <p> <a href="config.html#TreeWalker">TreeWalker</a> </p>
      </subsection>

    </section>
  </body>
</document>