1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="MatchXpath"> 5 <property name="query" 6 value="//CLASS_DEF[count(./OBJBLOCK/CTOR_DEF) > 1]"/> 7 <message key="matchxpath.match" 8 value="Classes with more than 1 constructor are not allowed"/> 9 </module> 10 </module> 11 </module> 12 */ 13 package com.puppycrawl.tools.checkstyle.checks.coding.matchxpath; 14 15 // xdoc section -- start 16 public class Example5 { 17 public Example5() { } 18 // violation below 'Classes with more than 1 constructor are not allowed' 19 class Inner { 20 public Inner(int a) { } 21 public Inner() { } 22 } 23 } 24 // xdoc section -- end