Class JavadocMethodCheck

    • Method Detail

      • setIgnoreMethodNamesRegex

        public void setIgnoreMethodNamesRegex​(Pattern pattern)
        Set regex for matching method names to ignore.
        Parameters:
        pattern - a pattern.
      • setMinLineCount

        public void setMinLineCount​(int value)
        Sets minimal amount of lines in method.
        Parameters:
        value - user's value.
      • setValidateThrows

        public void setValidateThrows​(boolean value)
        Allow validating throws tag.
        Parameters:
        value - user's value.
      • setAllowedAnnotations

        public void setAllowedAnnotations​(String... userAnnotations)
        Sets list of annotations.
        Parameters:
        userAnnotations - user's value.
      • setScope

        public void setScope​(Scope scope)
        Set the scope.
        Parameters:
        scope - a scope.
      • setExcludeScope

        public void setExcludeScope​(Scope excludeScope)
        Set the excludeScope.
        Parameters:
        excludeScope - a scope.
      • setAllowUndeclaredRTE

        public void setAllowUndeclaredRTE​(boolean flag)
        Controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.
        Parameters:
        flag - a Boolean value
      • setAllowThrowsTagsForSubclasses

        public void setAllowThrowsTagsForSubclasses​(boolean flag)
        Controls whether to allow documented exception that are subclass of one of declared exceptions.
        Parameters:
        flag - a Boolean value
      • setAllowMissingParamTags

        public void setAllowMissingParamTags​(boolean flag)
        Controls whether to allow a method which has parameters to omit matching param tags in the javadoc. Defaults to false.
        Parameters:
        flag - a Boolean value
      • setAllowMissingThrowsTags

        public void setAllowMissingThrowsTags​(boolean flag)
        Controls whether to allow a method which declares that it throws exceptions to omit matching throws tags in the javadoc. Defaults to false.
        Parameters:
        flag - a Boolean value
      • setAllowMissingReturnTag

        public void setAllowMissingReturnTag​(boolean flag)
        Controls whether to allow a method which returns non-void type to omit the return tag in the javadoc. Defaults to false.
        Parameters:
        flag - a Boolean value
      • setAllowMissingJavadoc

        public void setAllowMissingJavadoc​(boolean flag)
        Controls whether to ignore errors when there is no javadoc. Defaults to false.
        Parameters:
        flag - a Boolean value
      • setAllowMissingPropertyJavadoc

        public void setAllowMissingPropertyJavadoc​(boolean flag)
        Controls whether to ignore errors when there is no javadoc for a property accessor (setter/getter methods). Defaults to false.
        Parameters:
        flag - a Boolean value
      • getAcceptableTokens

        public int[] getAcceptableTokens()
        Description copied from class: AbstractCheck
        The configurable token set. Used to protect Checks against malicious users who specify an unacceptable token set in the configuration file. The default implementation returns the check's default tokens.
        Specified by:
        getAcceptableTokens in class AbstractCheck
        Returns:
        the token set this check is designed for.
        See Also:
        TokenTypes
      • isMissingJavadocAllowed

        protected boolean isMissingJavadocAllowed​(DetailAST ast)
        The JavadocMethodCheck is about to report a missing Javadoc. This hook can be used by derived classes to allow a missing javadoc in some situations. The default implementation checks allowMissingJavadoc and allowMissingPropertyJavadoc properties, do not forget to call super.isMissingJavadocAllowed(ast) in case you want to keep this logic.
        Parameters:
        ast - the tree node for the method or constructor.
        Returns:
        True if this method or constructor doesn't need Javadoc.