1 package com.puppycrawl.tools.checkstyle.checks.j2ee; 20 21 import com.puppycrawl.tools.checkstyle.api.DetailAST; 22 import com.puppycrawl.tools.checkstyle.api.TokenTypes; 23 24 28 public abstract class HomeInterfaceMethodChecker 29 extends MethodChecker 30 { 31 35 public HomeInterfaceMethodChecker(AbstractInterfaceCheck aCheck) 36 { 37 super(aCheck); 38 } 39 40 43 public void checkMethod(DetailAST aMethodAST) 44 { 45 final DetailAST nameAST = aMethodAST.findFirstToken(TokenTypes.IDENT); 48 final String name = nameAST.getText(); 49 if (name.startsWith("create")) { 50 checkCreateMethod(aMethodAST); 51 } 52 } 53 54 58 protected void checkCreateMethod(DetailAST aMethodAST) 59 { 60 if (Utils.isVoid(aMethodAST)) { 62 logName(aMethodAST, "voidmethod.bean", new Object [] {}); 63 } 64 65 checkThrows(aMethodAST, "javax.ejb.CreateException"); 67 } 68 } 69 | Popular Tags |