View Javadoc
1   /*
2   JavadocStyle
3   scope = (default)private
4   excludeScope = protected
5   checkFirstSentence = (default)true
6   endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$)
7   checkEmptyJavadoc = (default)false
8   checkHtml = (default)true
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 InputJavadocStyleExcludeScope1
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 InputJavadocStyleExcludeScope1() {}
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     // violation 7 lines below 'Unclosed HTML tag found: <b>'
56     // violation 9 lines below 'Extra HTML tag found: </td>'
57     // violation 9 lines below 'Extra HTML tag found: </style>'
58     // violation 9 lines below 'Unclosed HTML tag found: <code>dummy'
59     /**
60      * Test HTML in Javadoc comment
61      * <dl>
62      * <dt><b>
63      * <dd>The dt and dd don't require end tags.
64      * </dl>
65      * </td>
66      * <style>this tag isn't supported in Javadoc</style>
67      * @param arg1 <code>dummy
68      */
69     private void method5(int arg1) {}
70  
71     /**
72      * Protected check <b>should fail
73      */
74     protected void method6() {}
75  
76     // violation 2 lines below 'First sentence should end with a period.'
77     // violation 2 lines below 'Unclosed HTML tag found:'
78     /**
79      * Package protected check <b>
80      */
81     void method7() {}
82  
83     /**
84      * Public check should fail</code>
85      * should fail <
86      */
87     public void method8() {}
88  
89     /** {@inheritDoc} **/
90     public void method9() {}
91  
92  
93     // Testcases to exercise the Tag parser (bug 843887)
94     // violation 6 lines below  'Extra HTML tag found: </img>'
95      /**
96       * Real men don't use XHTML.
97       * <br />
98       * <hr/>
99       * < br/>
100      * <img src="schattenparker.jpg"/></img>
101      */
102     private void method10() {}
103 
104     /**
105      * Tag content can be really mean.
106      * <p>
107      * Sometimes a p tag is closed.
108      * </p>
109      * <p>
110      * Sometimes it's not.
111      *
112      * <span style="font-family:'Times New Roman',Times,serif;font-size:200%">
113      * Attributes can contain spaces and nested quotes.
114      * </span>
115      * <img src="slashesCanOccurWithin/attributes.jpg"/>
116      * <img src="slashesCanOccurWithin/attributes.jpg">
117      * <!-- comments <div> should not be checked. -->
118      */
119     private void method11() {}
120 }