View Javadoc
1   /*
2   JavadocStyle
3   scope = protected
4   excludeScope = (default)null
5   checkFirstSentence = (default)true
6   endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$)
7   checkEmptyJavadoc = true
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 InputJavadocStyleScopeProtected1
19  {
20     // This is OK. We don't flag missing javadoc.  That's left for other checks.
21     private String first;
22  
23     /** This Javadoc is missing an ending period */
24     private String second;
25  
26     /**
27      * We don't want {@link com.puppycrawl.tools.checkstyle.checks.JavadocStyleCheck}
28      * tags to stop the scan for the end of sentence.
29      * @see Something
30      */
31     public InputJavadocStyleScopeProtected1() {}
32  
33     /**
34      * This is ok!
35      */
36     private void method1() {}
37  
38     /**
39      * This is ok?
40      */
41     private void method2() {}
42  
43     /**
44      * And This is ok.<br>
45      */
46     private void method3() {}
47  
48     /**
49      * This should fail even.though.there are embedded periods
50      */
51     private void method4() {}
52  
53     /**
54      * Test HTML in Javadoc comment
55      * <dl>
56      * <dt><b>This guy is missing end of bold tag
57      * <dd>The dt and dd don't require end tags.
58      * </dl>
59      * </td>Extra tag shouldn't be here
60      * <style>this tag isn't supported in Javadoc</style>
61      * @param arg1 <code>dummy.
62      */
63     private void method5(int arg1) {}
64  
65     // violation 2 lines below 'First sentence should end with a period.'
66     // violation 2 lines below 'Unclosed HTML tag found: <b>'
67     /**
68      * Protected check <b>
69      */
70     protected void method6() {}
71  
72     /**
73      * Package protected check <b>should fail
74      */
75     void method7() {}
76  
77     // violation 3 lines below 'First sentence should end with a period.'
78     // violation 3 lines below 'Extra HTML tag found: </code>'
79     // violation 3 lines below 'should fail <'
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 }