Interface JavaNode
- All Superinterfaces:
GenericNode<JavaNode>,JjtreeNode<JavaNode>,Node,Reportable,TextAvailableNode
- All Known Subinterfaces:
Annotatable,ASTAssignableExpr,ASTAssignableExpr.ASTNamedReferenceExpr,ASTBodyDeclaration,ASTExecutableDeclaration,ASTExpression,ASTLiteral,ASTLoopStatement,ASTMemberValue,ASTPattern,ASTPrimaryExpression,ASTReferenceType,ASTStatement,ASTSwitchArrowRHS,ASTSwitchBranch,ASTSwitchLike,ASTTopLevelDeclaration,ASTType,ASTTypeDeclaration,FunctionalExpression,InvocationNode,JavadocCommentOwner,MethodUsage,ModifierOwner,QualifiableExpression,ReturnScopeNode,SymbolDeclaratorNode,TypeNode,TypeParamOwnerNode
- All Known Implementing Classes:
AbstractPackageNameModuleDirective,ASTAmbiguousName,ASTAnnotation,ASTAnnotationMemberList,ASTAnnotationTypeBody,ASTAnnotationTypeDeclaration,ASTAnonymousClassDeclaration,ASTArgumentList,ASTArrayAccess,ASTArrayAllocation,ASTArrayDimensions,ASTArrayDimExpr,ASTArrayInitializer,ASTArrayType,ASTArrayTypeDim,ASTAssertStatement,ASTAssignmentExpression,ASTBlock,ASTBooleanLiteral,ASTBreakStatement,ASTCastExpression,ASTCatchClause,ASTCatchParameter,ASTCharLiteral,ASTClassBody,ASTClassDeclaration,ASTClassLiteral,ASTClassType,ASTCompactConstructorDeclaration,ASTCompilationUnit,ASTConditionalExpression,ASTConstructorCall,ASTConstructorDeclaration,ASTContinueStatement,ASTDefaultValue,ASTDoStatement,ASTEmptyDeclaration,ASTEmptyStatement,ASTEnumBody,ASTEnumConstant,ASTEnumDeclaration,ASTExplicitConstructorInvocation,ASTExpressionStatement,ASTExtendsList,ASTFieldAccess,ASTFieldDeclaration,ASTFinallyClause,ASTForeachStatement,ASTForInit,ASTFormalParameter,ASTFormalParameters,ASTForStatement,ASTForUpdate,ASTGuard,ASTIfStatement,ASTImplementsList,ASTImplicitClassDeclaration,ASTImportDeclaration,ASTInfixExpression,ASTInitializer,ASTIntersectionType,ASTLabeledStatement,ASTLambdaExpression,ASTLambdaParameter,ASTLambdaParameterList,ASTList,ASTLocalClassStatement,ASTLocalVariableDeclaration,ASTMemberValueArrayInitializer,ASTMemberValuePair,ASTMethodCall,ASTMethodDeclaration,ASTMethodReference,ASTModifierList,ASTModuleDeclaration,ASTModuleDirective,ASTModuleExportsDirective,ASTModuleName,ASTModuleOpensDirective,ASTModuleProvidesDirective,ASTModuleRequiresDirective,ASTModuleUsesDirective,ASTNullLiteral,ASTNumericLiteral,ASTPackageDeclaration,ASTPatternExpression,ASTPatternList,ASTPermitsList,ASTPrimitiveType,ASTReceiverParameter,ASTRecordBody,ASTRecordComponent,ASTRecordComponentList,ASTRecordDeclaration,ASTRecordPattern,ASTResource,ASTResourceList,ASTReturnStatement,ASTStatementExpressionList,ASTStringLiteral,ASTSuperExpression,ASTSwitchArrowBranch,ASTSwitchExpression,ASTSwitchFallthroughBranch,ASTSwitchLabel,ASTSwitchStatement,ASTSynchronizedStatement,ASTThisExpression,ASTThrowsList,ASTThrowStatement,ASTTryStatement,ASTTypeArguments,ASTTypeBody,ASTTypeExpression,ASTTypeParameter,ASTTypeParameters,ASTTypePattern,ASTUnaryExpression,ASTUnionType,ASTUnnamedPattern,ASTVariableAccess,ASTVariableDeclarator,ASTVariableId,ASTVoidType,ASTWhileStatement,ASTWildcardType,ASTYieldStatement
Root interface for all Nodes of the Java AST.
-
Field Summary
Fields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptiondefault ASTTypeDeclarationReturns the node representing the type declaration this node is found in.@NonNull ASTCompilationUnitgetRoot()@NonNull JSymbolTableReturns the symbol table for the program point represented by this node.Returns the type system with which this node was created.Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSiblingMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode
getFirstToken, getLastToken, tokensMethods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getIndexInParent, getLanguageVersion, getNumChildren, getReportLocation, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundaryMethods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode
getOriginalText, getText, getTextRegion
-
Method Details
-
getEnclosingType
Returns the node representing the type declaration this node is found in. The type of that node is the type of thethisexpression.This returns null for nodes that aren't enclosed in a type declaration. This includes PackageDeclaration, This includes ImportDeclaration, ModuleDeclaration, CompilationUnit, and top-level TypeDeclarations.
-
getRoot
@NonNull ASTCompilationUnit getRoot() -
getSymbolTable
@NonNull JSymbolTable getSymbolTable()Returns the symbol table for the program point represented by this node. -
getTypeSystem
TypeSystem getTypeSystem()Returns the type system with which this node was created. This is the object responsible for representing types in the compilation unit.
-