1 package com.puppycrawl.tools.checkstyle.checks.whitespace; 20 21 import com.puppycrawl.tools.checkstyle.api.DetailAST; 22 import com.puppycrawl.tools.checkstyle.api.TokenTypes; 23 24 51 public class TypecastParenPadCheck extends AbstractParenPadCheck 52 { 53 54 public int[] getRequiredTokens() 55 { 56 return new int[] {TokenTypes.RPAREN, TokenTypes.TYPECAST}; 57 } 58 59 60 public int[] getDefaultTokens() 61 { 62 return getRequiredTokens(); 63 } 64 65 66 public void visitToken(DetailAST aAST) 67 { 68 if (aAST.getType() == TokenTypes.TYPECAST) { 71 processLeft(aAST); 72 } 73 else if ((aAST.getParent() != null) 74 && (aAST.getParent().getType() == TokenTypes.TYPECAST) 75 && (aAST.getParent().findFirstToken(TokenTypes.RPAREN) 76 == aAST)) 77 { 78 processRight(aAST); 79 } 80 } 81 } 82 | Popular Tags |