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

public Interface Node

extends AttributedObject
Known Direct Subinterfaces
org.glassfish.pfl.dynamic.codegen.impl.Statement
Known Direct Implementers
org.glassfish.pfl.dynamic.codegen.impl.ClassGeneratorImpl, org.glassfish.pfl.dynamic.codegen.impl.FieldGenerator, org.glassfish.pfl.dynamic.codegen.impl.MethodGenerator, org.glassfish.pfl.dynamic.codegen.impl.NodeBase

Represents a node in the AST used to generate code. All nodes support the dynamic attribute facility.
Author
Ken Cavanaugh

Method Summary

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

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

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

Make a deep copy of this node.

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

Copy setting a new parent in the result.

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

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

public int
id()

Return the unique ID of this node.

public Node
parent()

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

public void
parent(Node node)

Set the parent to a new value.

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

Method Detail

acceptback to summary
public void accept(Visitor visitor)

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

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

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)

Copy setting a new parent in the result.

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

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

idback to summary
public int 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 Node parent()

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

parentback to summary
public void parent(Node node)

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