| net.sourceforge.pmd.AbstractJavaRule net.sourceforge.pmd.rules.GenericLiteralCheckerRule
GenericLiteralCheckerRule | public class GenericLiteralCheckerRule extends AbstractJavaRule (Code) | | This class allow to match a Literal (most likely a String) with a regex pattern.
Obviously, there are many applications of it (such as basic.xml/AvoidUsingHardCodedIP).
author: Romain PELISSE, belaran@gmail.com |
visit | public Object visit(ASTLiteral node, Object data)(Code) | | This method checks if the Literal matches the pattern. If it does, a violation is logged.
|
Methods inherited from net.sourceforge.pmd.AbstractJavaRule | final protected void addViolation(Object data, SimpleNode node)(Code)(Java Doc) final protected void addViolation(Object data, SimpleNode node, String embed)(Code)(Java Doc) final protected void addViolation(Object data, Node node, Object[] args)(Code)(Java Doc) final protected void addViolationWithMessage(Object data, SimpleNode node, String msg)(Code)(Java Doc) public void apply(List acus, RuleContext ctx)(Code)(Java Doc) final protected String getDeclaringType(SimpleNode node)(Code)(Java Doc) public static boolean importsPackage(ASTCompilationUnit node, String packageName)(Code)(Java Doc) public static boolean isQualifiedName(SimpleNode node)(Code)(Java Doc) public Object visit(SimpleJavaNode node, Object data)(Code)(Java Doc) public Object visit(ASTExtendsList node, Object data)(Code)(Java Doc) public Object visit(ASTClassOrInterfaceDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTImplementsList node, Object data)(Code)(Java Doc) public Object visit(ASTTypeParameters node, Object data)(Code)(Java Doc) public Object visit(ASTMemberSelector node, Object data)(Code)(Java Doc) public Object visit(ASTTypeParameter node, Object data)(Code)(Java Doc) public Object visit(ASTTypeBound node, Object data)(Code)(Java Doc) public Object visit(ASTClassOrInterfaceBody node, Object data)(Code)(Java Doc) public Object visit(ASTClassOrInterfaceBodyDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTEnumBody node, Object data)(Code)(Java Doc) public Object visit(ASTEnumConstant node, Object data)(Code)(Java Doc) public Object visit(ASTReferenceType node, Object data)(Code)(Java Doc) public Object visit(ASTClassOrInterfaceType node, Object data)(Code)(Java Doc) public Object visit(ASTTypeArguments node, Object data)(Code)(Java Doc) public Object visit(ASTTypeArgument node, Object data)(Code)(Java Doc) public Object visit(ASTWildcardBounds node, Object data)(Code)(Java Doc) public Object visit(ASTAnnotation node, Object data)(Code)(Java Doc) public Object visit(ASTNormalAnnotation node, Object data)(Code)(Java Doc) public Object visit(ASTMarkerAnnotation node, Object data)(Code)(Java Doc) public Object visit(ASTSingleMemberAnnotation node, Object data)(Code)(Java Doc) public Object visit(ASTMemberValuePairs node, Object data)(Code)(Java Doc) public Object visit(ASTMemberValuePair node, Object data)(Code)(Java Doc) public Object visit(ASTMemberValue node, Object data)(Code)(Java Doc) public Object visit(ASTMemberValueArrayInitializer node, Object data)(Code)(Java Doc) public Object visit(ASTAnnotationTypeDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTAnnotationTypeBody node, Object data)(Code)(Java Doc) public Object visit(ASTAnnotationTypeMemberDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTDefaultValue node, Object data)(Code)(Java Doc) public Object visit(ASTRUNSIGNEDSHIFT node, Object data)(Code)(Java Doc) public Object visit(ASTRSIGNEDSHIFT node, Object data)(Code)(Java Doc) public Object visit(ASTCompilationUnit node, Object data)(Code)(Java Doc) public Object visit(ASTEnumDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTAssertStatement node, Object data)(Code)(Java Doc) public Object visit(ASTPackageDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTImportDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTTypeDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTFieldDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTVariableDeclarator node, Object data)(Code)(Java Doc) public Object visit(ASTVariableDeclaratorId node, Object data)(Code)(Java Doc) public Object visit(ASTVariableInitializer node, Object data)(Code)(Java Doc) public Object visit(ASTArrayInitializer node, Object data)(Code)(Java Doc) public Object visit(ASTMethodDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTMethodDeclarator node, Object data)(Code)(Java Doc) public Object visit(ASTFormalParameters node, Object data)(Code)(Java Doc) public Object visit(ASTFormalParameter node, Object data)(Code)(Java Doc) public Object visit(ASTConstructorDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTExplicitConstructorInvocation node, Object data)(Code)(Java Doc) public Object visit(ASTInitializer node, Object data)(Code)(Java Doc) public Object visit(ASTType node, Object data)(Code)(Java Doc) public Object visit(ASTPrimitiveType node, Object data)(Code)(Java Doc) public Object visit(ASTResultType node, Object data)(Code)(Java Doc) public Object visit(ASTName node, Object data)(Code)(Java Doc) public Object visit(ASTNameList node, Object data)(Code)(Java Doc) public Object visit(ASTExpression node, Object data)(Code)(Java Doc) public Object visit(ASTAssignmentOperator node, Object data)(Code)(Java Doc) public Object visit(ASTConditionalExpression node, Object data)(Code)(Java Doc) public Object visit(ASTConditionalOrExpression node, Object data)(Code)(Java Doc) public Object visit(ASTConditionalAndExpression node, Object data)(Code)(Java Doc) public Object visit(ASTInclusiveOrExpression node, Object data)(Code)(Java Doc) public Object visit(ASTExclusiveOrExpression node, Object data)(Code)(Java Doc) public Object visit(ASTAndExpression node, Object data)(Code)(Java Doc) public Object visit(ASTEqualityExpression node, Object data)(Code)(Java Doc) public Object visit(ASTInstanceOfExpression node, Object data)(Code)(Java Doc) public Object visit(ASTRelationalExpression node, Object data)(Code)(Java Doc) public Object visit(ASTShiftExpression node, Object data)(Code)(Java Doc) public Object visit(ASTAdditiveExpression node, Object data)(Code)(Java Doc) public Object visit(ASTMultiplicativeExpression node, Object data)(Code)(Java Doc) public Object visit(ASTUnaryExpression node, Object data)(Code)(Java Doc) public Object visit(ASTPreIncrementExpression node, Object data)(Code)(Java Doc) public Object visit(ASTPreDecrementExpression node, Object data)(Code)(Java Doc) public Object visit(ASTUnaryExpressionNotPlusMinus node, Object data)(Code)(Java Doc) public Object visit(ASTPostfixExpression node, Object data)(Code)(Java Doc) public Object visit(ASTCastExpression node, Object data)(Code)(Java Doc) public Object visit(ASTPrimaryExpression node, Object data)(Code)(Java Doc) public Object visit(ASTPrimaryPrefix node, Object data)(Code)(Java Doc) public Object visit(ASTPrimarySuffix node, Object data)(Code)(Java Doc) public Object visit(ASTLiteral node, Object data)(Code)(Java Doc) public Object visit(ASTBooleanLiteral node, Object data)(Code)(Java Doc) public Object visit(ASTNullLiteral node, Object data)(Code)(Java Doc) public Object visit(ASTArguments node, Object data)(Code)(Java Doc) public Object visit(ASTArgumentList node, Object data)(Code)(Java Doc) public Object visit(ASTAllocationExpression node, Object data)(Code)(Java Doc) public Object visit(ASTArrayDimsAndInits node, Object data)(Code)(Java Doc) public Object visit(ASTStatement node, Object data)(Code)(Java Doc) public Object visit(ASTLabeledStatement node, Object data)(Code)(Java Doc) public Object visit(ASTBlock node, Object data)(Code)(Java Doc) public Object visit(ASTBlockStatement node, Object data)(Code)(Java Doc) public Object visit(ASTLocalVariableDeclaration node, Object data)(Code)(Java Doc) public Object visit(ASTEmptyStatement node, Object data)(Code)(Java Doc) public Object visit(ASTStatementExpression node, Object data)(Code)(Java Doc) public Object visit(ASTSwitchStatement node, Object data)(Code)(Java Doc) public Object visit(ASTSwitchLabel node, Object data)(Code)(Java Doc) public Object visit(ASTIfStatement node, Object data)(Code)(Java Doc) public Object visit(ASTWhileStatement node, Object data)(Code)(Java Doc) public Object visit(ASTDoStatement node, Object data)(Code)(Java Doc) public Object visit(ASTForStatement node, Object data)(Code)(Java Doc) public Object visit(ASTForInit node, Object data)(Code)(Java Doc) public Object visit(ASTStatementExpressionList node, Object data)(Code)(Java Doc) public Object visit(ASTForUpdate node, Object data)(Code)(Java Doc) public Object visit(ASTBreakStatement node, Object data)(Code)(Java Doc) public Object visit(ASTContinueStatement node, Object data)(Code)(Java Doc) public Object visit(ASTReturnStatement node, Object data)(Code)(Java Doc) public Object visit(ASTThrowStatement node, Object data)(Code)(Java Doc) public Object visit(ASTSynchronizedStatement node, Object data)(Code)(Java Doc) public Object visit(ASTTryStatement node, Object data)(Code)(Java Doc) public Object visit(ASTFinallyStatement node, Object data)(Code)(Java Doc) public Object visit(ASTCatchStatement node, Object data)(Code)(Java Doc) protected void visitAll(List acus, RuleContext ctx)(Code)(Java Doc)
|
|
|