Class ASTClassOrInterfaceDeclaration

    • Method Detail

      • isLocal

        public boolean isLocal()
        Returns true if the class is declared inside a block other than the body of another class, or the top level.
      • isInterface

        public boolean isInterface()
      • getDeclarations

        public List<ASTAnyTypeBodyDeclaration> getDeclarations()
        Description copied from interface: ASTAnyTypeDeclaration
        Retrieves the member declarations (fields, methods, classes, etc.) from the body of this type declaration.
        Returns:
        The member declarations declared in this type declaration
      • getSuperClassTypeNode

        public ASTClassOrInterfaceType getSuperClassTypeNode()
        Returns the superclass type node if this node is a class declaration and explicitly declares an extends clause. Superinterfaces of an interface are not considered.

        Returns null otherwise.

      • getSuperInterfacesTypeNodes

        public List<ASTClassOrInterfaceType> getSuperInterfacesTypeNodes()
        Returns the interfaces implemented by this class, or extended by this interface. Returns an empty list if none is specified.
      • isSealed

        public boolean isSealed()
      • isNonSealed

        public boolean isNonSealed()
      • getAnnotation

        public ASTAnnotation getAnnotation​(String binaryName)
        Description copied from interface: Annotatable
        Returns a specific annotation on this node, or null if absent.
        Specified by:
        getAnnotation in interface Annotatable
        Parameters:
        binaryName - Binary name of the annotation type. Note: for now, canonical names are tolerated, this may be changed in PMD 7.
      • isAnnotationPresent

        public boolean isAnnotationPresent​(String binaryName)
        Description copied from interface: Annotatable
        Checks whether the annotation is present on this node.
        Specified by:
        isAnnotationPresent in interface Annotatable
        Parameters:
        binaryName - Binary name of the annotation type. Note: for now, canonical names are tolerated, this may be changed in PMD 7.
        Returns:
        true if the annotation is present on this node, else false
      • isAnyAnnotationPresent

        public boolean isAnyAnnotationPresent​(Collection<String> binaryNames)
        Description copied from interface: Annotatable
        Checks whether any annotation is present on this node.
        Specified by:
        isAnyAnnotationPresent in interface Annotatable
        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