View Javadoc
1   /*
2   AbbreviationAsWordInName
3   allowedAbbreviationLength = 4
4   allowedAbbreviations = MARAZMATIC, VARIABLE
5   ignoreFinal = false
6   ignoreStatic = false
7   ignoreStaticFinal = (default)true
8   ignoreOverriddenMethods = (default)true
9   tokens = CLASS_DEF, VARIABLE_DEF, METHOD_DEF, ENUM_DEF, ENUM_CONSTANT_DEF, PARAMETER_DEF, \
10           INTERFACE_DEF, ANNOTATION_DEF
11  
12  
13  */
14  
15  package com.puppycrawl.tools.checkstyle.checks.naming.abbreviationaswordinname;
16  
17  public class InputAbbreviationAsWordInNameIgnoreStaticFinal {
18  
19      abstract class InputAbbreviationAsWordInNameType {
20      }
21  
22      abstract class NonAAAAbstractClassName {
23      }
24  
25      abstract class FactoryWithBADNAme {
26      }
27  
28      abstract class AbstractCLASSName { // violation
29          abstract class NonAbstractInnerClass {
30          }
31      }
32  
33      abstract class ClassFactory1 {
34          abstract class WellNamedFactory {
35          }
36      }
37  
38      class NonAbstractClass1 {
39      }
40  
41      class AbstractClass1 {
42      }
43  
44      class Class1Factory1 {
45      }
46  
47      abstract class AbstractClassName3 {
48          class AbstractINNERRClass { // violation
49          }
50      }
51  
52      abstract class Class3Factory {
53          class WellNamedFACTORY { // violation
54              public void marazmaticMETHODName() { // violation
55                  int marazmaticVARIABLEName = 2;
56                  int MARAZMATICVariableName = 1;
57              }
58          }
59      }
60  
61      interface Directions {
62        int RIGHT=1;
63        int LEFT=2;
64        int UP=3;
65        int DOWN=4;
66      }
67  
68      interface BadNameForInterface
69      {
70         void interfaceMethod();
71      }
72  
73      abstract static class NonAAAAbstractClassName2 {
74          public int serialNUMBER = 6; // violation
75          public final int s1erialNUMBER = 6; // violation
76          private static int s2erialNUMBER = 6; // violation
77          private static final int s3erialNUMBER = 6;
78      }
79  
80      interface Interface1 {
81  
82          String VALUEEEE = "value"; // in interface this is final/static
83  
84      }
85  
86      interface Interface2 {
87  
88          static String VALUEEEE = "value"; // in interface this is final/static
89  
90      }
91  
92      interface Interface3 {
93  
94          final String VALUEEEE = "value"; // in interface this is final/static
95  
96      }
97  
98      interface Interface4 {
99  
100         final static String VALUEEEE = "value"; // in interface this is final/static
101 
102     }
103 
104     class FIleNameFormatException extends Exception {
105 
106         private static final long serialVersionUID = 1L;
107 
108         public FIleNameFormatException(Exception e) {
109             super(e);
110         }
111     }
112 
113     class StateX {
114         int userID;
115         int scaleX, scaleY, scaleZ;
116 
117         int getScaleX() {
118             return this.scaleX;
119         }
120     }
121 
122     @interface Annotation1 {
123         String VALUE = "value"; // in @interface this is final/static
124     }
125 
126     @interface Annotation2 {
127         static String VALUE = "value"; // in @interface this is final/static
128     }
129 
130     @interface Annotation3 {
131         final String VALUE = "value"; // in @interface this is final/static
132     }
133 
134     @interface Annotation4 {
135         final static String VALUE = "value"; // in @interface this is final/static
136     }
137 
138 }