Interface Annotatable

    • Field Summary

      • Fields inherited from interface net.sourceforge.pmd.lang.ast.Node

        COORDS_COMPARATOR
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default ASTAnnotation getAnnotation​(String binaryName)
      Returns a specific annotation on this node, or null if absent.
      default net.sourceforge.pmd.lang.ast.NodeStream<ASTAnnotation> getDeclaredAnnotations()
      Returns all annotations present on this node.
      default boolean isAnnotationPresent​(Class<?> type)
      Returns true if an annotation with the given type is applied to this node.
      default boolean isAnnotationPresent​(String annotQualifiedName)
      Returns true if an annotation with the given qualified name is applied to this node.
      default boolean isAnyAnnotationPresent​(Collection<String> binaryNames)
      Checks whether any annotation is present on this node.
      • Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode

        ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSibling
      • Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode

        getFirstToken, getLastToken, tokens
      • Methods inherited from interface net.sourceforge.pmd.lang.ast.Node

        acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getIndexInParent, getLanguageVersion, getNumChildren, getReportLocation, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundary
      • Methods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode

        getOriginalText, getText, getTextRegion
    • Method Detail

      • getDeclaredAnnotations

        default net.sourceforge.pmd.lang.ast.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