com.puppycrawl.tools.checkstyle.checks
Class AbstractFormatCheck

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.api.Check
              extended bycom.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
All Implemented Interfaces:
Configurable, Contextualizable
Direct Known Subclasses:
AbstractClassNameCheck, AbstractNameCheck, GenericIllegalRegexpCheck, IllegalTypeCheck, MutableExceptionCheck, PackageNameCheck, RequiredRegexpCheck, ReturnCountCheck, TodoCommentCheck, TrailingCommentCheck

public abstract class AbstractFormatCheck
extends Check

Abstract class for checks that verify strings using a regular expression. It provides support for setting the regular expression using the property name format.

Version:
1.0
Author:
Oliver Burn

Constructor Summary
AbstractFormatCheck(java.lang.String aDefaultFormat)
          Creates a new AbstractFormatCheck instance.
 
Method Summary
 java.lang.String getFormat()
           
 org.apache.regexp.RE getRegexp()
           
 void setFormat(java.lang.String aFormat)
          Set the format to the specified regular expression.
 
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, visitToken
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, 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

AbstractFormatCheck

public AbstractFormatCheck(java.lang.String aDefaultFormat)
                    throws org.apache.commons.beanutils.ConversionException
Creates a new AbstractFormatCheck instance.

Parameters:
aDefaultFormat - default format
Throws:
org.apache.commons.beanutils.ConversionException - unable to parse aDefaultFormat
Method Detail

setFormat

public void setFormat(java.lang.String aFormat)
               throws org.apache.commons.beanutils.ConversionException
Set the format to the specified regular expression.

Parameters:
aFormat - a String value
Throws:
org.apache.commons.beanutils.ConversionException - unable to parse aFormat

getRegexp

public org.apache.regexp.RE getRegexp()
Returns:
the regexp to match against

getFormat

public java.lang.String getFormat()
Returns:
the regexp format

Back to the Checkstyle Home Page