Interface Node
- All Superinterfaces:
AttributedObject
- All Known Subinterfaces:
ExpressionInternal
,Statement
,VariableInternal
- All Known Implementing Classes:
AssignmentStatement
,BlockStatement
,BreakStatement
,CaseBranch
,ClassGeneratorImpl
,DefinitionStatement
,ExpressionFactory.ArrayIndexExpression
,ExpressionFactory.ArrayLengthExpression
,ExpressionFactory.BinaryOperatorExpression
,ExpressionFactory.CallExpression
,ExpressionFactory.CastExpression
,ExpressionFactory.ConstantExpression
,ExpressionFactory.ExpressionBase
,ExpressionFactory.FieldAccessExpressionBase
,ExpressionFactory.IfExpression
,ExpressionFactory.InstofExpression
,ExpressionFactory.NewArrExpression
,ExpressionFactory.NewObjExpression
,ExpressionFactory.NonStaticCallExpression
,ExpressionFactory.NonStaticFieldAccessExpression
,ExpressionFactory.StaticCallExpression
,ExpressionFactory.StaticFieldAccessExpression
,ExpressionFactory.SuperCallExpression
,ExpressionFactory.SuperObjExpression
,ExpressionFactory.ThisExpression
,ExpressionFactory.ThisObjExpression
,ExpressionFactory.UnaryOperatorExpression
,ExpressionFactory.VariableImpl
,ExpressionFactory.VoidExpression
,FieldGenerator
,IfStatement
,MethodGenerator
,NodeBase
,ReturnStatement
,StatementBase
,SwitchStatement
,ThrowStatement
,TryStatement
,WhileStatement
Represents a node in the AST used to generate code. All nodes support the
dynamic attribute facility.
- Author:
- Ken Cavanaugh
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accept the visitor and allow it to perform actions on this Node.<T extends Node>
TMake a deep copy of this node.<T extends Node>
TCopy setting a new parent in the result.<T extends Node>
TgetAncestor
(Class<T> type) Return the first ancestor of this node of the given type, if any.int
id()
Return the unique ID of this node.parent()
Return the Node that contains (and created) this Node.void
Set the parent to a new value.Methods inherited from interface org.glassfish.pfl.dynamic.codegen.impl.AttributedObject
attributes, get, set
-
Method Details
-
parent
Node parent()Return the Node that contains (and created) this Node. -
id
int id()Return the unique ID of this node. This starts at 1 and is incremented for each new Node that is created. -
parent
Set the parent to a new value. Should only be called inside NodeBase. -
getAncestor
Return the first ancestor of this node of the given type, if any. Throws IllegalArgumentException if not found. -
copy
Make a deep copy of this node. If nn = n.copy(), then n.parent() == nn.parent(), which also means that the parent is NOT copied. -
copy
Copy setting a new parent in the result. -
accept
Accept the visitor and allow it to perform actions on this Node.
-