Class MethodNameCheck

java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck
com.puppycrawl.tools.checkstyle.checks.naming.AbstractAccessControlNameCheck
com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck
com.qulice.checkstyle.MethodNameCheck
All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable

public final class MethodNameCheck extends com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck
Names of methods, tolerant to the methods of a JNA binding.

The stock MethodName check demands the same format from every method, while a method of a type that extends com.sun.jna.Library carries the name of a native function, spelled the way the library that exports it spells it. Renaming it breaks the binding, so the check stays silent there.

Its messages come from the bundle of the stock check, since the two report the very same things and one wording for them is enough.

Since:
1.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean

    com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions
  • Field Summary

    Fields inherited from class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck

    MSG_KEY

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

    MSG_INVALID_PATTERN
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
     

    Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck

    getAcceptableTokens, getDefaultTokens, getRequiredTokens, setAllowClassName, setApplyToPackage, setApplyToPrivate, setApplyToProtected, setApplyToPublic

    Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractAccessControlNameCheck

    mustCheckName, shouldCheckInScope

    Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck

    setFormat

    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, getSeverity, getSeverityLevel, setId, setSeverity

    Methods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean

    configure, contextualize, getConfiguration, setupChild

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MethodNameCheck

      public MethodNameCheck()
      Default constructor.
  • Method Details

    • visitToken

      public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
      Overrides:
      visitToken in class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck
    • getMessageBundle

      public String getMessageBundle()
      Overrides:
      getMessageBundle in class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter