Class ASTMethodDeclaration

    • Constructor Detail

      • ASTMethodDeclaration

        public ASTMethodDeclaration​(int id)
      • ASTMethodDeclaration

        public ASTMethodDeclaration​(JavaParser p,
                                    int id)
    • Method Detail

      • getMethodName

        public java.lang.String getMethodName()
        Returns the simple name of the method.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface net.sourceforge.pmd.lang.dfa.DFAGraphMethod
      • isSyntacticallyPublic

        public boolean isSyntacticallyPublic()
        Returns true if this method is explicitly modified by the public modifier.
      • isSyntacticallyAbstract

        public boolean isSyntacticallyAbstract()
        Returns true if this method is explicitly modified by the abstract modifier.
      • isPublic

        public boolean isPublic()
        Returns true if this method has public visibility. Non-private interface members are implicitly public, whether they declare the public modifier or not.
        Specified by:
        isPublic in interface AccessNode
        Overrides:
        isPublic in class AbstractJavaAccessNode
      • isAbstract

        public boolean isAbstract()
        Returns true if this method is abstract, so doesn't declare a body. Interface members are implicitly abstract, whether they declare the abstract modifier or not. Default interface methods are not abstract though, consistently with the standard reflection API.
        Specified by:
        isAbstract in interface AccessNode
        Overrides:
        isAbstract in class AbstractJavaAccessNode
      • isInterfaceMember

        public boolean isInterfaceMember()
        Returns true if this method declaration is a member of an interface type.
      • isVoid

        public boolean isVoid()
        Returns true if the result type of this method is void.
      • getResultType

        public ASTResultType getResultType()
        Returns the result type node of the method.
      • getBlock

        public ASTBlock getBlock()
        Returns the block defined by this method, or null if the method is abstract.
      • getThrows

        public ASTNameList getThrows()
        Returns the exception names listed in the throws clause of this method declaration, or null if there are none.
      • getKind

        public MethodLikeNode.MethodLikeKind getKind()
        Description copied from interface: MethodLikeNode
        Returns a token indicating whether this node is a lambda expression or a method or constructor declaration. Can be used to downcast safely to a subinterface or an implementing class.
        Specified by:
        getKind in interface MethodLikeNode
        Returns:
        The kind of method-like
      • getMethodDeclarator

        public ASTMethodDeclarator getMethodDeclarator()
        Returns the method declarator. Never null.
      • getDeclaredAnnotations

        public java.util.List<ASTAnnotation> getDeclaredAnnotations()
        Description copied from interface: Annotatable
        Get all annotations present on this node.
        Specified by:
        getDeclaredAnnotations in interface Annotatable
        Returns:
        all annotations present on this node.
      • getAnnotation

        public ASTAnnotation getAnnotation​(java.lang.String annotQualifiedName)
        Description copied from interface: Annotatable
        Get specific annotaion on this node.
        Specified by:
        getAnnotation in interface Annotatable
        Parameters:
        annotQualifiedName - qulified name of the annotation.
        Returns:
        ASTAnnotaion node if the annotation is present on this node, else null
      • isAnnotationPresent

        public boolean isAnnotationPresent​(java.lang.String annotQualifiedName)
        Description copied from interface: Annotatable
        Checks whether the annotation is present on this node.
        Specified by:
        isAnnotationPresent in interface Annotatable
        Parameters:
        annotQualifiedName - qulified name of the annotation.
        Returns:
        true if the annotation is present on this node, else false
      • isAnyAnnotationPresent

        public boolean isAnyAnnotationPresent​(java.util.Collection<java.lang.String> annotQualifiedNames)
        Description copied from interface: Annotatable
        Checks whether any annotation is present on this node.
        Specified by:
        isAnyAnnotationPresent in interface Annotatable
        Parameters:
        annotQualifiedNames - collection that cotains qulified name of annotations.
        Returns:
        true if any annotation is present on this node, else false