View Javadoc
1   /*
2   JavadocStyle
3   scope = (default)private
4   excludeScope = (default)null
5   checkFirstSentence = (default)true
6   endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$)
7   checkEmptyJavadoc = (default)false
8   checkHtml = false
9   tokens = (default)ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, \
10           ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, PACKAGE_DEF, \
11           VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF
12  
13  
14  */
15  
16  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocstyle;
17  
18  public class InputJavadocStyleFirstSentenceOne
19  {
20     // This is OK. We don't flag missing javadoc.  That's left for other checks.
21     private String first;
22  
23     // violation below 'First sentence should end with a period.'
24     /** This Javadoc is missing an ending period */
25     private String second;
26  
27     /**
28      * We don't want {@link com.puppycrawl.tools.checkstyle.checks.JavadocStyleCheck}
29      * tags to stop the scan for the end of sentence.
30      * @see Something
31      */
32     public InputJavadocStyleFirstSentenceOne() {}
33  
34     /**
35      * This is ok!
36      */
37     private void method1() {}
38  
39     /**
40      * This is ok?
41      */
42     private void method2() {}
43  
44     /**
45      * And This is ok.<br>
46      */
47     private void method3() {}
48  
49     // violation below 'First sentence should end with a period.'
50     /**
51      * This should fail even.though.there are embedded periods
52      */
53     private void method4() {}
54  
55     /**
56      * Test HTML in Javadoc comment
57      * <dl>
58      * <dt><b>This guy is missing end of bold tag
59      * <dd>The dt and dd don't require end tags.
60      * </dl>
61      * </td>Extra tag shouldn't be here
62      * <style>this tag isn't supported in Javadoc</style>
63      * @param arg1 <code>dummy.
64      */
65     private void method5(int arg1) {}
66  
67     // violation below 'First sentence should end with a period.'
68     /**
69      * Protected check <b>should fail
70      */
71     protected void method6() {}
72  
73     // violation below 'First sentence should end with a period.'
74     /**
75      * Package protected check <b>should fail
76      */
77     void method7() {}
78  
79     // violation below 'First sentence should end with a period.'
80     /**
81      * Public check should fail</code>
82      * should fail <
83      */
84     public void method8() {}
85  
86     /** {@inheritDoc} **/
87     public void method9() {}
88  
89  
90      // Testcases to exercise the Tag parser (bug 843887)
91  
92      /**
93       * Real men don't use XHTML.
94       * <br />
95       * <hr/>
96       * < br/>
97       * <img src="schattenparker.jpg"/></img>
98       */
99      private void method10() {}
100 
101     /**
102      * Tag content can be really mean.
103      * <p>
104      * Sometimes a p tag is closed.
105      * </p>
106      * <p>
107      * Sometimes it's not.
108      *
109      * <span style="font-family:'Times New Roman',Times,serif;font-size:200%">
110      * Attributes can contain spaces and nested quotes.
111      * </span>
112      * <img src="slashesCanOccurWithin/attributes.jpg"/>
113      * <img src="slashesCanOccurWithin/attributes.jpg">
114      * <!-- comments <div> should not be checked. -->
115      */
116     private void method11() {}
117 }