Class ASTAnnotation

    • Method Detail

      • getAnnotationName

        public String getAnnotationName()
        Returns the name of the annotation as it is used, eg java.lang.Override or Override.
      • suppresses

        public boolean suppresses​(Rule rule)
        Returns true if this annotation suppresses the given rule. The suppression annotation is SuppressWarnings. This method returns true if this annotation is a SuppressWarnings, and if the set of suppressed warnings (SuppressWarnings.value()) contains at least one of those:
        • "PMD" (suppresses all rules);
        • "PMD.rulename", where rulename is the name of the given rule;
        • "all" (conventional value to suppress all warnings).

        Additionally, the following values suppress a specific set of rules:

        • "unused": suppresses rules like UnusedLocalVariable or UnusedPrivateField;
        • "serial": suppresses BeanMembersShouldSerialize and MissingSerialVersionUID;
        Parameters:
        rule - The rule for which to check for suppression
        Returns:
        True if this annotation suppresses the given rule