public class ImportNode extends FixedChildrenNode implements IImportNode
IImportNode.ImportKind
Modifier and Type | Field and Description |
---|---|
protected IImportNode.ImportKind |
importKind |
protected ExpressionNodeBase |
targetImportNode
Package to import
|
emptyNodeArray, parent
UNKNOWN
Constructor and Description |
---|
ImportNode(ExpressionNodeBase targetImportNode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
analyze(EnumSet<PostProcessStep> set,
ASScope scope,
Collection<ICompilerProblem> problems) |
static ImportNode |
buildImportNode(String qname)
Builds an ImportNode for a qname.
|
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
IASNode |
getChild(int i)
Get a particular child of this node
|
int |
getChildCount()
Get the number of children
|
IImportNode.ImportKind |
getImportKind()
Returns the type that this import represents
|
String |
getImportName()
Get the name of the target definition we are importing
|
IExpressionNode |
getImportNameNode()
Returns the expression underlying this import node
|
IImportTarget |
getImportTarget()
Creates an import target for the given import
|
ASTNodeID |
getNodeID()
Get the opcode of this node
|
boolean |
isWildcardImport()
Returns whether an import statement is a wildcard import or not
|
static String |
makeWildcardName(String name)
Turns a qualified name such as
"flash.display.Sprite"
into a wildcard name like "flash.display. |
void |
normalize(boolean fillInOffsets)
Normalize the tree.
|
IDefinition |
resolveImport(ICompilerProject project)
Returns the definition being imported, or
null
if this is a wildcard import or if the import name
cannot be resolved. |
protected void |
setChildren(boolean fillInOffsets)
If this node has custom children (names, arguments, etc), shove them into
the list of children.
|
void |
setImportKind(IImportNode.ImportKind importKind)
Sets the type of import we have encountered.
|
void |
setImportTarget(ExpressionNodeBase targetImportNode)
Sets the import target.
|
isTerminal
buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getASScope, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTransparent, looselyContains, replaceChild, runPostProcess, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, swapChildren, toString, tryGetOffsetLookup, verify
getColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, getAncestorOfType, getContainingNode, getContainingScope, getFileSpecification, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
protected ExpressionNodeBase targetImportNode
protected IImportNode.ImportKind importKind
public ImportNode(ExpressionNodeBase targetImportNode)
targetImportNode
- package to importpublic static ImportNode buildImportNode(String qname)
public static String makeWildcardName(String name)
"flash.display.Sprite"
into a wildcard name like "flash.display.*"
.public ASTNodeID getNodeID()
IASNode
public int getChildCount()
IASNode
getChildCount
in interface IASNode
getChildCount
in class NodeBase
public IASNode getChild(int i)
IASNode
protected void setChildren(boolean fillInOffsets)
NodeBase
setChildren
in class NodeBase
public void normalize(boolean fillInOffsets)
NodeBase
protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
protected boolean buildInnerString(StringBuilder sb)
NodeBase
buildOuterString()
.
It is overridden by subclasses to display optional node-specific
information in the middle of the string, between the node type and the
location information.buildInnerString
in class NodeBase
public IImportNode.ImportKind getImportKind()
IImportNode
getImportKind
in interface IImportNode
IImportNode
public IExpressionNode getImportNameNode()
IImportNode
getImportNameNode
in interface IImportNode
IExpressionNode
for this importpublic String getImportName()
IImportNode
getImportName
in interface IImportNode
public IImportTarget getImportTarget()
IImportNode
getImportTarget
in interface IImportNode
IImportTarget
public boolean isWildcardImport()
IImportNode
isWildcardImport
in interface IImportNode
public IDefinition resolveImport(ICompilerProject project)
IImportNode
null
if this is a wildcard import or if the import name
cannot be resolved.resolveImport
in interface IImportNode
project
- An ICompilerProject
within which references
are resolved.IDefinition
or null
.public void setImportKind(IImportNode.ImportKind importKind)
importKind
- The type of import.public void setImportTarget(ExpressionNodeBase targetImportNode)
targetImportNode
- The node representing the import target.Copyright © 2016 The Apache Software Foundation. All rights reserved.