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 = (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 InputJavadocStyleDefaultSettingsOne
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 InputJavadocStyleDefaultSettingsOne() {}
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     // violation 2 lines below 'First sentence should end with a period.'
72     // violation 2 lines below 'Unclosed HTML tag found: <b>'
73     /**
74      * Protected check <b>
75      */
76     protected void method6() {}
77  
78     // violation 2 lines below 'First sentence should end with a period.'
79     // violation 2 lines below 'Unclosed HTML tag found: <b>'
80     /**
81      * Package protected check <b>
82      */
83     void method7() {}
84  
85     // violation 3 lines below 'First sentence should end with a period.'
86     // violation 3 lines below 'Extra HTML tag found: </code>'
87     // violation 3 lines below 'should fail <'
88     /**
89      * Public check should fail</code>
90      * should fail <
91      */
92     public void method8() {}
93  
94     /** {@inheritDoc} **/
95     public void method9() {}
96  
97      /**
98       * Tag content can be really mean.
99       * <p>
100      * Sometimes a p tag is closed.
101      * </p>
102      * <p>
103      * Sometimes it's not.
104      *
105      * <span style="font-family:'Times New Roman',Times,serif;font-size:200%">
106      * Attributes can contain spaces and nested quotes.
107      * </span>
108      * <img src="slashesCanOccurWithin/attributes.jpg"/>
109      * <img src="slashesCanOccurWithin/attributes.jpg">
110      * <!-- comments <div> should not be checked. -->
111      */
112     private void method10() {}
113     /**
114      * Tags for two lines.
115      * <a href="some_link"
116      * >Link Text</a>
117      */
118     private void method11() {}
119 }