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

public interface JavaNode extends JjtreeNode<JavaNode>
Root interface for all Nodes of the Java AST.
  • Method Details

    • getEnclosingType

      default ASTTypeDeclaration getEnclosingType()
      Returns the node representing the type declaration this node is found in. The type of that node is the type of the this expression.

      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()
      Specified by:
      getRoot in interface Node
    • 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.