View Javadoc
1   /*
2   SummaryJavadoc
3   violateExecutionOnNonTightHtml = (default)false
4   forbiddenSummaryFragments = (default)^$
5   period = (default).
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.javadoc.summaryjavadoc;
11  
12  /**
13   * Config: default.
14   */
15  class InputSummaryJavadocInlineDefault {
16  
17      /**
18       * {@summary A simple correct Javadoc.}
19       */
20      void foo1() {} // ok
21      /**
22       * {@summary This code is wrong }
23       */ // violation above 'Summary .* missing an ending period.'
24      void foo5(){}
25      /**
26       * {@summary This code {@see Javadoc} is wrong }
27       */ // violation above 'Summary .* missing an ending period.'
28      void foo6(){}
29      // violation below 'Summary javadoc is missing.'
30      /**
31       * {@sometag This code {@see Javadoc} is wrong }
32       */
33      void foo7(){}
34  
35      /**
36       * {@summary <p>This code is right.</p>}
37       */
38      void foo8(){} // ok
39      /**
40       * {@summary As of , replaced by {@link #setBounds(int,int,int,int)}}
41       */ // violation above 'Summary .* missing an ending period.'
42      void foo11() {}
43      /**
44       * {@summary {@throws Exception if a problem occurs}}
45       */ // violation above 'Summary .* missing an ending period.'
46      void foo12() throws Exception {}
47  
48      /** {@summary An especially short bit of Javadoc.} */
49      void foo13() {} // ok
50  
51      /**
52       * {@summary Some Javadoc.}
53       */
54      public static final byte NUL = 0; // ok
55      /**
56       * {@summary <a href="mailto:vlad@htmlbook.ru"/>}
57       */ // violation above 'Summary javadoc is missing.'
58      class InnerInputCorrectJavaDocParagraphCheck {
59          /**
60           * {@summary foooo@foooo}
61           */ // violation above 'Summary .* missing an ending period.'
62          public static final byte NUL = 0;
63  
64          /**
65           * {@summary Some java@doc.}
66           */
67          public static final byte NUL_2 = 0; // ok
68  
69          /**
70           * {@summary This method
71           * returns some javadoc. Some javadoc.}
72           */
73          boolean emulated() {return false;} // ok
74  
75          /**
76           * {@summary @return the
77           * customer ID some javadoc.}
78           */
79          int geId() {return 666;} // ok
80  
81          /**
82           * {@summary from {@link #setBounds(int,int,int,int)}.}
83           */
84          void foo3() {} // ok
85  
86          /** {@summary  An especially short bit of Javadoc.} */
87          void foo5() {} // ok
88  
89          /**
90           * {@summary An especially short bit of Javadoc.}
91           */
92          void foo6() {} // ok
93      }
94  
95      /**
96       * {@summary A {@code InnerInputCorrectJavaDocParagraphCheck} is a simple code.}
97       */
98      InputSummaryJavadocInlineDefault.InnerInputCorrectJavaDocParagraphCheck anon =
99              new InputSummaryJavadocInlineDefault.InnerInputCorrectJavaDocParagraphCheck() {
100 
101         /**
102          * Some Javadoc.
103          */
104         public static final byte NUL = 0; // ok
105 
106         /**
107          * Some Javadoc.
108          */
109         void emulated(String s) {} // ok
110 
111         /**
112          * from {@link #setBounds(int,int,int,int)}.
113          */
114         void foo3() {} // ok
115         /**
116          * {@summary {}@throws Exception if a problem occurs}
117          */ // violation above 'Summary .* missing an ending period.'
118         void foo4() throws Exception {}
119     // violation below 'First sentence .* missing an ending period.'
120         /**
121          * mm{@inheritDoc}
122          */
123         void foo7() {}
124     // violation below 'Summary javadoc is missing.'
125         /**
126          * {@link #setBounds(int,int,int,int)}
127          */
128         void foo8() {}
129 
130         /**
131          * {@summary {@code see} .}
132          */
133         void foo10() {} // ok
134     };
135     /**
136      * {@summary M m m m {@inheritDoc}}
137      */ // violation above 'Summary .* missing an ending period.'
138     void foo14() {}
139 
140     /**{@summary @summary .} */
141     int foo15() {return 0;} // ok
142 
143     /**
144      * {@summary @author Akash Mondal.}
145      */
146     void foo16(){} // ok
147 
148     /**
149      * {@summary {@input Javadoc}.}
150      */
151     void foo17(){} // ok
152     /**
153      * {@summary}
154      */ // violation above 'Summary javadoc is missing.'
155     void foo22() {}
156 
157     /** */
158     String[] foo9() {return null;} // violation above 'Summary javadoc is missing.'
159 
160     /**
161      * {@summary Javadoc {@code code} correct.}
162      */
163     void foo23(){} // ok
164 
165     /**
166      * {@summary first doesn't have period
167      * Use of html tags:
168      * <ul>
169      * <li>Item one.</li>
170      * <li>Period here.</li>
171      * </ul>}
172      */
173     private void invalidInlineJavadocTwo() // ok
174     {
175     }
176 
177     // violation 2 lines below 'Summary .* missing an ending period.'
178     /**
179      * {@summary first sentence is normally the summary.
180      * Use of html tags:
181      * {@code SomeCodeHere.}
182      * <ul>
183      * <li>Item one.</li>
184      * <li>No period here</li>
185      * </ul>}
186      */
187     private void invalidInlineJavadocList()
188     {
189     }
190 }