Top Description Fields Constructors Methods
org.glassfish.pfl.dynamic.codegen.impl

public Class NodeBase

extends AttributedObjectBase
implements Node, CopyInterceptor
Class Inheritance
All Implemented Interfaces
org.glassfish.pfl.dynamic.copyobject.spi.CopyInterceptor, org.glassfish.pfl.dynamic.codegen.impl.Node, org.glassfish.pfl.dynamic.codegen.impl.AttributedObject
Known Direct Subclasses
org.glassfish.pfl.dynamic.codegen.impl.StatementBase, org.glassfish.pfl.dynamic.codegen.impl.ExpressionFactory.ExpressionBase
Imports
org.glassfish.pfl.dynamic.copyobject.spi.Copy, .CopyInterceptor, .CopyType, .DefaultCopier

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.
Author
Ken Cavanaugh

Field Summary

Modifier and TypeField and Description
private int
private static int
private Node

Constructor Summary

AccessConstructor and Description
public
NodeBase(Node parent)

Method Summary

Modifier and TypeMethod and Description
public void
accept(Visitor visitor)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.accept.

Accept the visitor and allow it to perform actions on this Node.

public <T extends Node> T
copy(Class<T> cls)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.copy.

Make a deep copy of this node.

public <T extends Node> T
copy(Node newParent, Class<T> cls)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.copy.

Copy setting a new parent in the result.

public final <T extends Node> T
getAncestor(Class<T> type)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.getAncestor.

Return the first ancestor of this node of the given type, if any.

private static synchronized int
public int
id()

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.id.

Return the unique ID of this node.

public final Node
parent()

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Return the Node that contains (and created) this Node.

public final void
parent(Node node)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Set the parent to a new value.

public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase:
attributesgetset

Field Detail

myIdback to summary
private int myId
nextIdback to summary
private static int nextId
parentback to summary
private Node parent
Annotations
@Copy:IDENTITY

Constructor Detail

NodeBaseback to summary
public NodeBase(Node parent)

Method Detail

acceptback to summary
public void accept(Visitor visitor)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.accept.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.accept.

Accept the visitor and allow it to perform actions on this Node.

copyback to summary
public <T extends Node> T copy(Class<T> cls)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.copy.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.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.

copyback to summary
public <T extends Node> T copy(Node newParent, Class<T> cls)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.copy.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.copy.

Copy setting a new parent in the result.

getAncestorback to summary
public final <T extends Node> T getAncestor(Class<T> type)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.getAncestor.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.getAncestor.

Return the first ancestor of this node of the given type, if any. Throws IllegalArgumentException if not found.

getNewIdback to summary
private static synchronized int getNewId()
idback to summary
public int id()

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.id.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.id.

Return the unique ID of this node. This starts at 1 and is incremented for each new Node that is created.

parentback to summary
public final Node parent()

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Return the Node that contains (and created) this Node.

parentback to summary
public final void parent(Node node)

Implements org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Doc from org.glassfish.pfl.dynamic.codegen.impl.Node.parent.

Set the parent to a new value. Should only be called inside NodeBase.

postCopyback to summary
public void postCopy()

Overrides org.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase.postCopy.

Implements org.glassfish.pfl.dynamic.copyobject.spi.CopyInterceptor.postCopy.

preCopyback to summary
public void preCopy()

Overrides org.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase.preCopy.

Implements org.glassfish.pfl.dynamic.copyobject.spi.CopyInterceptor.preCopy.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.