public class FileNode extends ScopedBlockNode implements Serializable, IFileNode, IFileNodeAccumulator
IContainerNode.ContainerTypescopeEMPTY_CONTAINERemptyNodeArray, parentUNKNOWN| Constructor and Description |
|---|
FileNode(IFileSpecificationGetter fileSpecGetter)
Constructor for a
FileNode that does not have a source file
associated with it. |
FileNode(IFileSpecificationGetter fileSpecGetter,
String pathName)
Constructor for a
FileNode that has a source file
associated with it. |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeferredFunctionNode(FunctionNode functionNode)
Add a function node whose body contents are deferred.
|
void |
addEmbedNode(IEmbedResolver node)
Adds an embed node to the list of embed nodes within this file.
|
void |
addImportNode(IImportNode node)
Adds an import node to the list of import nodes within this file.
|
void |
addProblem(ICompilerProblem problem) |
void |
addRequiredResourceBundle(String bundleName)
Adds a Resource Bundle to the set of Resource Bundles that are referenced
within this file.
|
protected void |
analyze(EnumSet<PostProcessStep> set,
ASScope scope,
Collection<ICompilerProblem> problems) |
void |
collectImportNodes(Collection<IImportNode> importNodes)
Collects the import nodes that are descendants of this node
but which are not contained within a scoped node.
|
List<IEmbedResolver> |
getEmbedNodes()
Returns the list of EmbedNodes
|
IFileSpecificationGetter |
getFileSpecificaitonGetter()
Gets the
IFileSpecificationGetter for that was used to open
included files when this FileNode was parsed. |
IFileSpecification |
getFileSpecification()
Get the
IFileSpecification that produced this node |
List<IImportNode> |
getImportNodes()
Returns the list of the ImportNodes
|
IncludeHandler |
getIncludeHandler()
Gets the
IncludeHandler for this file node. |
long |
getIncludeTreeLastModified()
Returns a last modification timestamp of the current include file tree
|
ASTNodeID |
getNodeID()
Get the opcode of this node
|
OffsetLookup |
getOffsetLookup() |
Collection<ICompilerProblem> |
getProblems()
Returns the problems that are contained in this file.
|
Set<String> |
getRequiredResourceBundles() |
ITargetAttributes |
getTargetAttributes(ICompilerProject project)
If this
IFileNode can be used as the MXML main application or
ActionScript main class, it returns attributes related to SWF target. |
IASScope |
getTemporaryEnclosingScope(RecursionGuard scopeGuard)
Retrieve the temporary enclosing scope (which is used to make an included
file look like it's inside the scope where the include statement lives.
|
IDefinitionNode[] |
getTopLevelDefinitionNodes(boolean includeDefinitionsOutsideOfPackage,
boolean includeNonPublicDefinitions)
Gets definition nodes within this file node that are children
of the file node or children of a package block node.
|
IDefinition[] |
getTopLevelDefinitions(boolean includeDefinitionsOutsideOfPackage,
boolean includeNonPublicDefinitions)
Gets the definitions corresponding to the definitions nodes
within this file node that are children of the file node
or children of a package block node.
|
IWorkspace |
getWorkspace()
Get's the
IWorkspace in which this NodeBase lives. |
boolean |
hasIncludes() |
protected void |
initializeScope(ASScope containingScope) |
void |
parseRequiredFunctionBodies()
Run through all the deferredFunctionNodes, and if their containing
scope isn't file, package or class, it needs to be parsed
|
void |
populateFunctionNodes()
Rebuild function body nodes.
|
void |
processAST(EnumSet<PostProcessStep> features) |
void |
reconnectDefinitions(ASFileScope fileScope) |
void |
setOffsetLookup(OffsetLookup offsetLookup) |
void |
setParent(NodeBase parent)
Set the parent node.
|
void |
setProblems(Collection<ICompilerProblem> problems) |
getAllImportNodes, getAllImports, getASScope, getScope, optimizeChildren, runPostProcess, runPostProcess, setScopereplaceChildaddItem, addItemAfterNormalization, addTemporaryItem, buildInnerString, contains, getContainerType, getRemovedConditionalCompileNode, removeItem, removeTemporaryItem, setContainerType, setRemovedConditionalCompileNodeaddChild, addChild, addChildInOrder, addChildPostNormalize, addTemporaryChild, getChild, getChildCount, getInitialChildCount, normalize, removeAllChildren, removeChild, removeTemporaryChild, sortChildren, swapChildrenbuildStringRecursive, canContinueContainmentSearch, combineAttributes, connectedToProjectScope, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, isTerminal, isTransparent, looselyContains, setChildren, span, span, span, startAfter, startAfter, startBefore, startBefore, 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, waitgetAllImportNodes, getAllImports, getScopecontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartpublic FileNode(IFileSpecificationGetter fileSpecGetter, String pathName)
FileNode that has a source file
associated with it.fileSpecGetter - The IFileSpecificationGetter to be
used to open included files while parsing the file for this file node.pathName - The path name of the file for this file node.public FileNode(IFileSpecificationGetter fileSpecGetter)
FileNode that does not have a source file
associated with it.fileSpecGetter - The IFileSpecificationGetter to be
used to open included files while parsing this file node.public ASTNodeID getNodeID()
IASNodepublic IFileSpecification getFileSpecification()
IASNodeIFileSpecification that produced this nodegetFileSpecification in interface IASNodegetFileSpecification in class NodeBasepublic IWorkspace getWorkspace()
NodeBaseIWorkspace in which this NodeBase lives.getWorkspace in class NodeBaseIWorkspace in which this NodeBase lives.public void setParent(NodeBase parent)
NodeBaseprotected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
analyze in class ScopedBlockNodepublic void collectImportNodes(Collection<IImportNode> importNodes)
NodeBase
This is a helper method for IScopedNode.getAllImportNodes(java.util.Collection<org.apache.flex.compiler.tree.as.IImportNode>)().
Since that method walks up the chain of scoped nodes, we don't want
to look inside scoped nodes that were already processed.
collectImportNodes in class NodeBaseimportNodes - The collection of import nodes being built.public OffsetLookup getOffsetLookup()
getOffsetLookup in interface IFileNodepublic boolean hasIncludes()
hasIncludes in interface IFileNodepublic long getIncludeTreeLastModified()
IFileNodegetIncludeTreeLastModified in interface IFileNodepublic IDefinitionNode[] getTopLevelDefinitionNodes(boolean includeDefinitionsOutsideOfPackage, boolean includeNonPublicDefinitions)
IFileNodegetTopLevelDefinitionNodes in interface IFileNodeincludeDefinitionsOutsideOfPackage - A flag indicating whether
definition nodes that aren't in a package should be included.includeNonPublicDefinitions - A flag indicating whether
definition nodes that don't have a public keyword should be included.IDefinitionNode objects.public IDefinition[] getTopLevelDefinitions(boolean includeDefinitionsOutsideOfPackage, boolean includeNonPublicDefinitions)
IFileNodegetTopLevelDefinitions in interface IFileNodeincludeDefinitionsOutsideOfPackage - A flag indicating whether
definitions that aren't in a package should be included.includeNonPublicDefinitions - A flag indicating whether definitions
that don't have a public keyword should be included.IDefinition objects.public ITargetAttributes getTargetAttributes(ICompilerProject project)
IFileNodeIFileNode can be used as the MXML main application or
ActionScript main class, it returns attributes related to SWF target.
Otherwise, this method returns null.getTargetAttributes in interface IFileNodeproject - Context project.public Collection<ICompilerProblem> getProblems()
IFileNodegetProblems in interface IFileNodeICompilerProblem objectspublic void addImportNode(IImportNode node)
IFileNodeAccumulatoraddImportNode in interface IFileNodeAccumulatornode - Node to addpublic List<IImportNode> getImportNodes()
IFileNodeAccumulatorgetImportNodes in interface IFileNodeAccumulatorpublic void addEmbedNode(IEmbedResolver node)
IFileNodeAccumulatoraddEmbedNode in interface IFileNodeAccumulatornode - Node to addpublic List<IEmbedResolver> getEmbedNodes()
IFileNodeAccumulatorgetEmbedNodes in interface IFileNodeAccumulatorpublic void addRequiredResourceBundle(String bundleName)
IFileNodeAccumulatoraddRequiredResourceBundle in interface IFileNodeAccumulatorbundleName - name of the Resource Bundlepublic Set<String> getRequiredResourceBundles()
getRequiredResourceBundles in interface IFileNodeAccumulatorpublic void addDeferredFunctionNode(FunctionNode functionNode)
IFileNodeAccumulatoraddDeferredFunctionNode in interface IFileNodeAccumulatorfunctionNode - Function node.public void populateFunctionNodes()
IFileNodepopulateFunctionNodes in interface IFileNodepublic void parseRequiredFunctionBodies()
public IFileSpecificationGetter getFileSpecificaitonGetter()
IFileSpecificationGetter for that was used to open
included files when this FileNode was parsed.IFileSpecificationGetter for that was used to open
included files when this FileNode was parsed.public void setOffsetLookup(OffsetLookup offsetLookup)
public IncludeHandler getIncludeHandler()
IncludeHandler for this file node. The
IncludeHandler can be used to get a list of files included by
this file.IncludeHandler for this file node.public IASScope getTemporaryEnclosingScope(RecursionGuard scopeGuard)
public void processAST(EnumSet<PostProcessStep> features)
public void reconnectDefinitions(ASFileScope fileScope)
protected void initializeScope(ASScope containingScope)
public void setProblems(Collection<ICompilerProblem> problems)
public void addProblem(ICompilerProblem problem)
Copyright © 2016 The Apache Software Foundation. All rights reserved.