1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="MethodName"/> 5 <module name="SuppressionXpathSingleFilter"> 6 <property name="checks" value="MethodName"/> 7 <property name="query" value="//CLASS_DEF[./IDENT[@text='Example8']]/OBJBLOCK/ 8 METHOD_DEF/IDENT[@text='MyMethod1' or @text='MyMethod2']"/> 9 </module> 10 </module> 11 </module> 12 */ 13 14 package com.puppycrawl.tools.checkstyle.filters.suppressionxpathsinglefilter; 15 16 // xdoc section -- start 17 class Example8 { 18 // filtered violation below 'Name 'MyMethod1' must match pattern' 19 public void MyMethod1() {} 20 // filtered violation below 'Name 'MyMethod2' must match pattern' 21 public void MyMethod2() {} 22 // violation below, 'Name 'MyMethod3' must match pattern' 23 public void MyMethod3() {} 24 } 25 // xdoc section -- end