Class ASTMethodDeclaration

    • Method Detail

      • getMethodName

        @Deprecated
        @DeprecatedAttribute(replaceWith="@Name")
        public String getMethodName()
        Deprecated.
        Returns the simple name of the method.
      • 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

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

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

        public int getArity()
        Returns the number of formal parameters expected by this method (excluding any receiver parameter). A varargs parameter counts as one.
      • 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

        @Deprecated
        public ASTMethodDeclarator getMethodDeclarator()
        Deprecated.
        Method declarator nodes will be removed with 7.0.0
        Returns the method declarator. Never null.
      • getAnnotation

        public ASTAnnotation getAnnotation​(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​(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​(Collection<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