Class NodeBase
java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase
org.glassfish.pfl.dynamic.codegen.impl.NodeBase
- All Implemented Interfaces:
AttributedObject, Node, CopyInterceptor
- Direct Known Subclasses:
ExpressionFactory.ExpressionBase, StatementBase
Base class for implementing various kinds of Nodes in the AST.
This mainly supports dynamic attributes. It also supports
dynamic delegation to another node. Dynamic attributes not
found in the current node will automatically be searched for
in the delegate.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept 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.final <T extends Node>
TgetAncestor(Class<T> type) Return the first ancestor of this node of the given type, if any.private static intgetNewId()intid()Return the unique ID of this node.final Nodeparent()Return the Node that contains (and created) this Node.final voidSet the parent to a new value.voidpostCopy()voidpreCopy()toString()Methods inherited from class AttributedObjectBase
attributes, get, setMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributedObject
attributes, get, set
-
Field Details
-
parent
-
nextId
private static int nextId -
myId
private int myId
-
-
Constructor Details
-
NodeBase
-
-
Method Details
-
preCopy
public void preCopy()- Specified by:
preCopyin interfaceCopyInterceptor- Overrides:
preCopyin classAttributedObjectBase
-
postCopy
public void postCopy()- Specified by:
postCopyin interfaceCopyInterceptor- Overrides:
postCopyin classAttributedObjectBase
-
getNewId
private static int getNewId() -
getAncestor
Description copied from interface:NodeReturn the first ancestor of this node of the given type, if any. Throws IllegalArgumentException if not found.- Specified by:
getAncestorin interfaceNode
-
id
-
parent
-
parent
-
copy
-
copy
-
toString
-
accept
-