com.puppycrawl.tools.checkstyle.checks.naming
Class AbstractNameCheck

java.lang.Object
  extended by com.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended by com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended by com.puppycrawl.tools.checkstyle.api.Check
              extended by com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
                  extended by com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck
All Implemented Interfaces:
Configurable, Contextualizable
Direct Known Subclasses:
AbstractAccessControlNameCheck, AbstractTypeParameterNameCheck, LocalFinalVariableNameCheck, LocalVariableNameCheck, ParameterNameCheck

public abstract class AbstractNameCheck
extends AbstractFormatCheck

Abstract class for checking that names conform to a specified format.

Version:
1.0
Author:
Rick Giles

Constructor Summary
AbstractNameCheck(java.lang.String aFormat)
          Creates a new AbstractNameCheck instance.
 
Method Summary
protected  boolean mustCheckName(DetailAST aAST)
          Decides whether the name of an AST should be checked against the format regexp.
 void visitToken(DetailAST aAST)
          Called to process a token.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
getFormat, getRegexp, setCompileFlags, setFormat
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNameCheck

public AbstractNameCheck(java.lang.String aFormat)
Creates a new AbstractNameCheck instance.

Parameters:
aFormat - format to check with
Method Detail

mustCheckName

protected boolean mustCheckName(DetailAST aAST)
Decides whether the name of an AST should be checked against the format regexp.

Parameters:
aAST - the AST to check.
Returns:
true if the IDENT subnode of aAST should be checked against the format regexp.

visitToken

public void visitToken(DetailAST aAST)
Description copied from class: Check
Called to process a token.

Overrides:
visitToken in class Check
Parameters:
aAST - the token to process


Copyright © 2001-2011. All Rights Reserved.