public class NodeReference extends Object
Modifier and Type | Field and Description |
---|---|
static NodeReference |
noReference
static that represents no NodeReference (e.g. for defs that came from an ABC)
|
Constructor and Description |
---|
NodeReference(IASNode node)
Construct a NodeReference to the given node
|
NodeReference(IFileSpecification containingFileSpec,
int absoluteStart)
Construct a NodeReference to a node in the specified file at the
specified offset.
|
Modifier and Type | Method and Description |
---|---|
int |
getAbsoluteStart()
Get the start offset for the node
|
IFileSpecification |
getFileSpecification()
Get the file spec for this Node
|
IASNode |
getNode(IWorkspace workspace,
ASScope scope)
Get a strong reference to the Node.
|
IASNode |
getNodeIfExists()
Get the node from the underlying weak reference.
|
void |
reconnectNode(IASNode node)
Explicitly re-connect this node reference to the specified node.
|
public static NodeReference noReference
public NodeReference(IASNode node)
node
- the node to referencespublic NodeReference(IFileSpecification containingFileSpec, int absoluteStart)
containingFileSpec
- File that contains the node this reference
refers to.absoluteStart
- The offset at which the node this reference refers to
starts.public IFileSpecification getFileSpecification()
public int getAbsoluteStart()
public IASNode getNode(IWorkspace workspace, ASScope scope)
workspace
- the Workspace to use to parse the filescope
- the containing scope of the definition we want the node for - this is used
to find the ASFileScope it's contained in to reconnect the definitions and Nodes
if the file needs to be reparsedpublic IASNode getNodeIfExists()
Copyright © 2016 The Apache Software Foundation. All rights reserved.