net.sourceforge.pmd.lang.ast.Node
, net.sourceforge.pmd.lang.ast.QualifiableNode
, net.sourceforge.pmd.lang.ast.SignedNode<ASTMethodOrConstructorDeclaration>
, net.sourceforge.pmd.lang.dfa.DFAGraphMethod
, AccessNode
, Annotatable
, ASTMethodOrConstructorDeclaration
, JavaNode
, JavaQualifiableNode
, MethodLikeNode
, net.sourceforge.pmd.lang.symboltable.ScopedNode
public class ASTMethodDeclaration extends AbstractMethodOrConstructorDeclaration implements net.sourceforge.pmd.lang.dfa.DFAGraphMethod
MethodDeclaration := [ TypeParameters() ] (TypeAnnotation())* ResultType() MethodDeclarator() [ "throws" NameList() ] ( Block() | ";" )
MethodLikeNode.MethodLikeKind
parser
Constructor | Description |
---|---|
ASTMethodDeclaration(int id) |
|
ASTMethodDeclaration(JavaParser p,
int id) |
Modifier and Type | Method | Description |
---|---|---|
ASTAnnotation |
getAnnotation(java.lang.String annotQualifiedName) |
Get specific annotaion on this node.
|
ASTBlock |
getBlock() |
Returns the block defined by this method, or
null if the method is abstract.
|
java.util.List<ASTAnnotation> |
getDeclaredAnnotations() |
Get all annotations present on this node.
|
ASTFormalParameters |
getFormalParameters() |
|
MethodLikeNode.MethodLikeKind |
getKind() |
Returns a token indicating whether this node is a lambda
expression or a method or constructor declaration.
|
ASTMethodDeclarator |
getMethodDeclarator() |
Returns the method declarator.
|
java.lang.String |
getMethodName() |
Returns the simple name of the method.
|
java.lang.String |
getName() |
|
ASTResultType |
getResultType() |
Returns the result type node of the method.
|
ASTNameList |
getThrows() |
Returns the exception names listed in the
throws clause
of this method declaration, or null if there are none. |
boolean |
isAbstract() |
Returns true if this method is abstract, so doesn't
declare a body.
|
boolean |
isAnnotationPresent(java.lang.String annotQualifiedName) |
Checks whether the annotation is present on this node.
|
boolean |
isAnyAnnotationPresent(java.util.Collection<java.lang.String> annotQualifiedNames) |
Checks whether any annotation is present on this node.
|
boolean |
isInterfaceMember() |
Returns true if this method declaration is a member of an interface type.
|
boolean |
isPublic() |
Returns true if this method has public visibility.
|
boolean |
isSyntacticallyAbstract() |
Returns true if this method is explicitly modified by
the
abstract modifier. |
boolean |
isSyntacticallyPublic() |
Returns true if this method is explicitly modified by
the
public modifier. |
boolean |
isVoid() |
Returns true if the result type of this method is
void . |
java.lang.Object |
jjtAccept(JavaParserVisitor visitor,
java.lang.Object data) |
Accept the visitor.
|
getModifiers, isDefault, isFinal, isNative, isPackagePrivate, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setAbstract, setDefault, setFinal, setModifiers, setNative, setPrivate, setProtected, setPublic, setStatic, setStrictfp, setSynchronized, setTransient, setVolatile
childrenAccept, comment, comment, getScope, getXPathNodeName, jjtClose, jjtOpen, setScope
getQualifiedName, setQualifiedName
getSignature
appendElement, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfAnyType, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetFirstToken, jjtGetId, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData, testingOnlySetBeginColumn, testingOnlySetBeginLine, testingOnlySetEndColumn, testingOnlySetEndLine, toString
getModifiers, isDefault, isFinal, isNative, isPackagePrivate, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setAbstract, setDefault, setFinal, setModifiers, setNative, setPrivate, setProtected, setPublic, setStatic, setStrictfp, setSynchronized, setTransient, setVolatile
childrenAccept, getScope, setScope
getQualifiedName
findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, getXPathNodeName, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData
public ASTMethodDeclaration(int id)
public ASTMethodDeclaration(JavaParser p, int id)
public java.lang.Object jjtAccept(JavaParserVisitor visitor, java.lang.Object data)
AbstractJavaNode
jjtAccept
in interface JavaNode
jjtAccept
in class AbstractJavaNode
public java.lang.String getMethodName()
public java.lang.String getName()
getName
in interface net.sourceforge.pmd.lang.dfa.DFAGraphMethod
public boolean isSyntacticallyPublic()
public
modifier.public boolean isSyntacticallyAbstract()
abstract
modifier.public boolean isPublic()
public
modifier or
not.isPublic
in interface AccessNode
isPublic
in class AbstractJavaAccessNode
public boolean isAbstract()
abstract
modifier or not.isAbstract
in interface AccessNode
isAbstract
in class AbstractJavaAccessNode
public boolean isInterfaceMember()
public boolean isVoid()
void
.public ASTResultType getResultType()
public ASTBlock getBlock()
public ASTNameList getThrows()
throws
clause
of this method declaration, or null if there are none.public MethodLikeNode.MethodLikeKind getKind()
MethodLikeNode
getKind
in interface MethodLikeNode
public ASTFormalParameters getFormalParameters()
public ASTMethodDeclarator getMethodDeclarator()
public java.util.List<ASTAnnotation> getDeclaredAnnotations()
Annotatable
getDeclaredAnnotations
in interface Annotatable
public ASTAnnotation getAnnotation(java.lang.String annotQualifiedName)
Annotatable
getAnnotation
in interface Annotatable
annotQualifiedName
- qulified name of the annotation.ASTAnnotaion
node if the annotation is present on this node, else null
public boolean isAnnotationPresent(java.lang.String annotQualifiedName)
Annotatable
isAnnotationPresent
in interface Annotatable
annotQualifiedName
- qulified name of the annotation.true
if the annotation is present on this node, else false
public boolean isAnyAnnotationPresent(java.util.Collection<java.lang.String> annotQualifiedNames)
Annotatable
isAnyAnnotationPresent
in interface Annotatable
annotQualifiedNames
- collection that cotains qulified name of annotations.true
if any annotation is present on this node, else false
Copyright © 2002–2018 PMD. All rights reserved.