1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="LocalFinalVariableName"> 5 <property name="format" value="^[A-Z][A-Z0-9]*$"/> 6 </module> 7 <module name="MethodName"> 8 <property name="format" value="^[a-z](_?[a-zA-Z0-9]+)*$"/> 9 </module> 10 <module name="SuppressionXpathSingleFilter"> 11 <property name="checks" value=".*"/> 12 <property name="query" value="//METHOD_DEF[./IDENT[@text='TestMethod1']] 13 /descendant-or-self::node()"/> 14 </module> 15 </module> 16 </module> 17 */ 18 19 package com.puppycrawl.tools.checkstyle.filters.suppressionxpathsinglefilter; 20 21 // xdoc section -- start 22 public class Example13 { 23 // filtered violation below 'Name 'TestMethod1' must match pattern' 24 public void TestMethod1() { 25 // filtered violation below 'Name 'num' must match pattern' 26 final int num = 10; 27 } 28 29 // violation below, 'Name 'TestMethod2' must match pattern' 30 public void TestMethod2() { 31 // violation below, 'Name 'num' must match pattern' 32 final int num = 10; 33 } 34 } 35 // xdoc section -- end