View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="InterfaceMemberImpliedModifier">
5         <property name="violateImpliedPublicNested" value="false"/>
6         <property name="violateImpliedStaticNested" value="false"/>
7       </module>
8     </module>
9   </module>
10  */
11  package com.puppycrawl.tools.checkstyle.checks.modifier.interfacememberimpliedmodifier;
12  
13  import java.util.List;
14  
15  // xdoc section -- start
16  public interface Example2 {
17  
18    public static final String UNKNOWN = "Unknown";
19    String OTHER = "Other";
20    // 3 violations above:
21    //    'Implied modifier 'final' should be explicit'
22    //    'Implied modifier 'public' should be explicit'
23    //    'Implied modifier 'static' should be explicit'
24    public static Example2 instance() { return null; }
25  
26    public abstract Address createAddress(String addressLine, String city);
27    List<Address> findAddresses(String city);
28    // 2 violations above:
29    //    'Implied modifier 'abstract' should be explicit'
30    //    'Implied modifier 'public' should be explicit'
31    interface Address {
32      // OK above because of configured properties
33      // OK above because of configured properties
34  
35      String getCity();
36      // 2 violations above:
37      //    'Implied modifier 'abstract' should be explicit'
38      //    'Implied modifier 'public' should be explicit'
39    }
40  }
41  // xdoc section -- end