View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="MatchXpath">
5         <property name="query"
6              value="//METHOD_DEF[.//LITERAL_PRIVATE
7                     and following-sibling::METHOD_DEF[.//LITERAL_PUBLIC]]"/>
8         <message key="matchxpath.match"
9              value="Private methods must appear after public methods"/>
10      </module>
11    </module>
12  </module>
13  */
14  package com.puppycrawl.tools.checkstyle.checks.coding.matchxpath;
15  
16  // xdoc section -- start
17  public class Example1 {
18    public void method1() { }
19    // violation below 'Private methods must appear after public methods'
20    private void method2() { }
21    public void method3() { }
22    // violation below 'Private methods must appear after public methods'
23    private void method4() { }
24    public void method5() { }
25    private void method6() { }
26  }
27  // xdoc section -- end