Class InterfaceTypeParameterNameCheck

  • All Implemented Interfaces:
    com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable

    public class InterfaceTypeParameterNameCheck
    extends com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck

    Checks that interface type parameter names conform to a format specified by the format property. The format is a regular expression and defaults to ^[A-Z]$.

    An example of how to configure the check is:

     <module name="InterfaceTypeParameterName"/>
     

    An example of how to configure the check for names that are only a single letter is

     <module name="InterfaceTypeParameterName">
        <property name="format" value="^[a-zA-Z]$"/>
     </module>
     
    Since:
    1.8.0
    Version:
    1.0
    Author:
    Dmitry Gridyushko
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

        com.puppycrawl.tools.checkstyle.api.AutomaticBean.OutputStreamOptions
    • Field Summary

      • Fields inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck

        MSG_INVALID_PATTERN
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int[] getAcceptableTokens()  
      int[] getDefaultTokens()  
      int[] getRequiredTokens()  
      protected boolean mustCheckName​(com.puppycrawl.tools.checkstyle.api.DetailAST ast)  
      • Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck

        setFormat, visitToken
      • Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck

        beginTree, clearViolations, destroy, finishTree, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
      • Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

        finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
      • Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

        configure, contextualize, getConfiguration, setupChild
    • Constructor Detail

      • InterfaceTypeParameterNameCheck

        public InterfaceTypeParameterNameCheck()
        Creates a new InterfaceTypeParameterNameCheck instance.
    • Method Detail

      • getDefaultTokens

        public final int[] getDefaultTokens()
        Specified by:
        getDefaultTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
      • getAcceptableTokens

        public int[] getAcceptableTokens()
        Specified by:
        getAcceptableTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
      • getRequiredTokens

        public int[] getRequiredTokens()
        Specified by:
        getRequiredTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
      • mustCheckName

        protected final boolean mustCheckName​(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
        Specified by:
        mustCheckName in class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck