Interface Annotatable

    • Method Detail

      • getDeclaredAnnotations

        default NodeStream<ASTAnnotation> getDeclaredAnnotations()
        Returns all annotations present on this node.
      • isAnnotationPresent

        default boolean isAnnotationPresent​(String annotQualifiedName)
        Returns true if an annotation with the given qualified name is applied to this node.
        Parameters:
        annotQualifiedName - Note: for now, canonical names are tolerated, this may be changed in PMD 7.
      • isAnnotationPresent

        default boolean isAnnotationPresent​(Class<?> type)
        Returns true if an annotation with the given type is applied to this node.
      • getAnnotation

        default ASTAnnotation getAnnotation​(String binaryName)
        Returns a specific annotation on this node, or null if absent.
        Parameters:
        binaryName - Binary name of the annotation type. Note: for now, canonical names are tolerated, this may be changed in PMD 7.
      • isAnyAnnotationPresent

        default boolean isAnyAnnotationPresent​(Collection<String> binaryNames)
        Checks whether any annotation is present on this node.
        Parameters:
        binaryNames - Collection that contains binary names of annotations. Note: for now, canonical names are tolerated, this may be changed in PMD 7.
        Returns:
        true if any annotation is present on this node, else false