Class IllegalMethodCallCheck

    • Constructor Detail

      • IllegalMethodCallCheck

        public IllegalMethodCallCheck()
    • Method Detail

      • isRelevantCall

        protected boolean isRelevantCall​(@Nullable
                                         String pQualifier,
                                         @Nonnull
                                         String pMethodName)
        Description copied from class: AbstractMethodCallCheck
        Filter method which determines if the given method call is considered relevant.
        Specified by:
        isRelevantCall in class AbstractMethodCallCheck
        Parameters:
        pQualifier - the qualifier of the method call (for a call like Foo.Bar.call(), the qualifier is Foo.Bar)
        pMethodName - the simple name of the called method
        Returns:
        indication of whether the call is relevant (true) or not (false)
      • visitMethodCall

        protected void visitMethodCall​(@Nonnull
                                       String pMethodName,
                                       @Nonnull
                                       DetailAST pMethodCallAst)
        Description copied from class: AbstractMethodCallCheck
        Visitor method called when a relevant method call is encountered. This method is called in addition to the other visitor methods.
        Specified by:
        visitMethodCall in class AbstractMethodCallCheck
        Parameters:
        pMethodName - the simple name of the called method
        pMethodCallAst - AST of the call, useful for logging issues ( this is a METHOD_DEF, CTOR_CALL, or a SUPER_CTOR_CALL token)
      • setIllegalMethodNames

        public void setIllegalMethodNames​(String... pIllegalMethodNames)
        Setter.
        Parameters:
        pIllegalMethodNames - the list of method names to flag
      • setExcludedQualifiers

        public void setExcludedQualifiers​(String... pExcludedQualifiers)
        Setter.
        Parameters:
        pExcludedQualifiers - the list of excluded contexts