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, parentUNKNOWN| 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.
|
isTerminalbuildStringRecursive, 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, verifygetColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, spanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, getAncestorOfType, getContainingNode, getContainingScope, getFileSpecification, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartprotected 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()
IASNodepublic int getChildCount()
IASNodegetChildCount in interface IASNodegetChildCount in class NodeBasepublic IASNode getChild(int i)
IASNodeprotected void setChildren(boolean fillInOffsets)
NodeBasesetChildren in class NodeBasepublic void normalize(boolean fillInOffsets)
NodeBaseprotected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
protected boolean buildInnerString(StringBuilder sb)
NodeBasebuildOuterString().
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 NodeBasepublic IImportNode.ImportKind getImportKind()
IImportNodegetImportKind in interface IImportNodeIImportNodepublic IExpressionNode getImportNameNode()
IImportNodegetImportNameNode in interface IImportNodeIExpressionNode for this importpublic String getImportName()
IImportNodegetImportName in interface IImportNodepublic IImportTarget getImportTarget()
IImportNodegetImportTarget in interface IImportNodeIImportTargetpublic boolean isWildcardImport()
IImportNodeisWildcardImport in interface IImportNodepublic IDefinition resolveImport(ICompilerProject project)
IImportNodenull
if this is a wildcard import or if the import name
cannot be resolved.resolveImport in interface IImportNodeproject - 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.