View Javadoc
1   /*
2   JavadocVariable
3   scope = public
4   excludeScope = (default)null
5   ignoreNamePattern = (default)null
6   tokens = (default)ENUM_CONSTANT_DEF
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocvariable;
12  
13  public class InputJavadocVariablePublicOnly2 // ignore - need javadoc
14  {
15      private interface InnerInterface // ignore - when not relaxed about Javadoc
16      {
17          String CONST = "InnerInterface"; // ignore - w.n.r.a.j
18          void method(); // ignore - when not relaxed about Javadoc
19  
20          class InnerInnerClass // ignore - when not relaxed about Javadoc
21          {
22              private int mData; // ignore - when not relaxed about Javadoc
23  
24              private InnerInnerClass()
25              {
26                  final Runnable r = new Runnable() {
27                          public void run() {};
28                      };
29              }
30  
31              void method2() // ignore - when not relaxed about Javadoc
32              {
33                  final Runnable r = new Runnable() {
34                          public void run() {};
35                      };
36              }
37          }
38      }
39  
40      private class InnerClass // ignore
41      {
42          private int mDiff; // ignore - when not relaxed about Javadoc
43  
44          void method() // ignore - when not relaxed about Javadoc
45          {
46          }
47      }
48  
49      private int mSize; // ignore - when not relaxed about Javadoc
50      int mLen; // ignore - when not relaxed about Javadoc
51      protected int mDeer; // ignore
52      public int aFreddo; // violation
53  
54      // ignore - need Javadoc
55      private InputJavadocVariablePublicOnly2(int aA)
56      {
57      }
58  
59      // ignore - need Javadoc when not relaxed
60      InputJavadocVariablePublicOnly2(String aA)
61      {
62      }
63  
64      // ignore - always need javadoc
65      protected InputJavadocVariablePublicOnly2(Object aA)
66      {
67      }
68  
69      // ignore - always need javadoc
70      public InputJavadocVariablePublicOnly2(Class<Object> aA)
71      {
72      }
73  
74      // ignore - when not relaxed about Javadoc
75      private void method(int aA)
76      {
77      }
78  
79      // ignore - when not relaxed about Javadoc
80      void method(Long aA)
81      {
82      }
83  
84      // ignore - need javadoc
85      protected void method(Class<Object> aA)
86      {
87      }
88  
89      // ignore - need javadoc
90      public void method(StringBuffer aA)
91      {
92      }
93  
94  
95      /**
96         A param tag should not be required here when relaxed about Javadoc.
97         Writing a little documentation should not be worse than not
98         writing any documentation at all.
99       */
100     private void method(String aA)
101     {
102     }
103 
104     /**
105        This inner class has no author tag, which is OK.
106      */
107     public class InnerWithoutAuthor
108     {
109 
110     }
111 
112     /** {@inheritDoc} */
113     public String toString()
114     {
115         return super.toString();
116     }
117 
118     @Deprecated @Override
119     public int hashCode()
120     {
121         return super.hashCode();
122     }
123 }