View Javadoc
1   /*
2   JavadocStyle
3   scope = public
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 InputJavadocStyleScopePublic1
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 InputJavadocStyleScopePublic1() {}
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     /**
66      * Protected check <b>should fail
67      */
68     protected void method6() {}
69  
70     /**
71      * Package protected check <b>should fail
72      */
73     void method7() {}
74  
75     // violation 3 lines below 'First sentence should end with a period.'
76     // violation 3 lines below 'Extra HTML tag found: </code>'
77     // violation 3 lines below 'should fail <'
78     /**
79      * Public check should fail</code>
80      * should fail <
81      */
82     public void method8() {}
83  
84     /** {@inheritDoc} **/
85     public void method9() {}
86  
87      // Testcases to exercise the Tag parser (bug 843887)
88  
89      /**
90       * Real men don't use XHTML.
91       * <br />
92       * <hr/>
93       * < br/>
94       * <img src="schattenparker.jpg"/></img>
95       */
96      private void method10() {}
97  
98      /**
99       * Tag content can be really mean.
100      * <p>
101      * Sometimes a p tag is closed.
102      * </p>
103      * <p>
104      * Sometimes it's not.
105      *
106      * <span style="font-family:'Times New Roman',Times,serif;font-size:200%">
107      * Attributes can contain spaces and nested quotes.
108      * </span>
109      * <img src="slashesCanOccurWithin/attributes.jpg"/>
110      * <img src="slashesCanOccurWithin/attributes.jpg">
111      * <!-- comments <div> should not be checked. -->
112      */
113     private void method11() {}
114 }