Interface Annotatable
-
- All Superinterfaces:
JavaNode
,Node
,ScopedNode
- All Known Implementing Classes:
AbstractAnyTypeDeclaration
,AbstractJavaAccessNode
,AbstractJavaAccessTypeNode
,AbstractMethodLikeNode
,AbstractMethodOrConstructorDeclaration
,ASTAnnotationMethodDeclaration
,ASTAnnotationTypeDeclaration
,ASTClassOrInterfaceDeclaration
,ASTCompactConstructorDeclaration
,ASTConstructorDeclaration
,ASTEnumDeclaration
,ASTFieldDeclaration
,ASTFormalParameter
,ASTLambdaExpression
,ASTLocalVariableDeclaration
,ASTMethodDeclaration
,ASTPackageDeclaration
,ASTRecordComponent
,ASTRecordDeclaration
,ASTResource
,ASTTypePattern
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 binaryName)
Returns a specific annotation on this node, or null if absent.List<ASTAnnotation>
getDeclaredAnnotations()
Get all annotations present on this node.boolean
isAnnotationPresent(String binaryName)
Checks whether the annotation is present on this node.boolean
isAnyAnnotationPresent(Collection<String> binaryNames)
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 binaryName)
Returns a specific annotation on this node, or null if absent.- Parameters:
binaryName
- Binary name of the annotation type. Note: for now, canonical names are tolerated, this may be changed in PMD 7.
-
isAnyAnnotationPresent
boolean isAnyAnnotationPresent(Collection<String> binaryNames)
Checks whether any annotation is present on this node.- 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, elsefalse
-
isAnnotationPresent
boolean isAnnotationPresent(String binaryName)
Checks whether the annotation is present on this node.- 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, elsefalse
-
-