Interface Annotatable
-
- All Superinterfaces:
JavaNode
,Node
,ScopedNode
- All Known Implementing Classes:
AbstractAnyTypeDeclaration
,AbstractJavaAccessNode
,AbstractJavaAccessTypeNode
,AbstractMethodLikeNode
,AbstractMethodOrConstructorDeclaration
,ASTAnnotationMethodDeclaration
,ASTAnnotationTypeDeclaration
,ASTClassOrInterfaceDeclaration
,ASTConstructorDeclaration
,ASTEnumDeclaration
,ASTFieldDeclaration
,ASTFormalParameter
,ASTLambdaExpression
,ASTLocalVariableDeclaration
,ASTMethodDeclaration
,ASTPackageDeclaration
,ASTRecordComponent
,ASTRecordConstructorDeclaration
,ASTRecordDeclaration
,ASTResource
public interface Annotatable extends JavaNode
The interface use to mark nodes that can be annotated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ASTAnnotation
getAnnotation(String annotQualifiedName)
Get specific annotaion on this node.List<ASTAnnotation>
getDeclaredAnnotations()
Get all annotations present on this node.boolean
isAnnotationPresent(String annotQualifiedName)
Checks whether the annotation is present on this node.boolean
isAnyAnnotationPresent(Collection<String> annotQualifiedNames)
Checks whether any annotation is present on this node.-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
children, childrenAccept, getChild, getParent, getRoot, jjtAccept, setScope
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.Node
findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getIndexInParent, getNthParent, getNumChildren, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData
-
Methods inherited from interface net.sourceforge.pmd.lang.symboltable.ScopedNode
getScope
-
-
-
-
Method Detail
-
getDeclaredAnnotations
List<ASTAnnotation> getDeclaredAnnotations()
Get all annotations present on this node.- Returns:
- all annotations present on this node.
-
getAnnotation
ASTAnnotation getAnnotation(String annotQualifiedName)
Get specific annotaion on this node.- Parameters:
annotQualifiedName
- qulified name of the annotation.- Returns:
ASTAnnotaion
node if the annotation is present on this node, elsenull
-
isAnyAnnotationPresent
boolean isAnyAnnotationPresent(Collection<String> annotQualifiedNames)
Checks whether any annotation is present on this node.- Parameters:
annotQualifiedNames
- collection that cotains qulified name of annotations.- Returns:
true
if any annotation is present on this node, elsefalse
-
isAnnotationPresent
boolean isAnnotationPresent(String annotQualifiedName)
Checks whether the annotation is present on this node.- Parameters:
annotQualifiedName
- qulified name of the annotation.- Returns:
true
if the annotation is present on this node, elsefalse
-
-