public class FileNode extends ScopedBlockNode implements Serializable, IFileNode, IFileNodeAccumulator
IContainerNode.ContainerType
scope
EMPTY_CONTAINER
emptyNodeArray, parent
UNKNOWN
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, setScope
replaceChild
addItem, addItemAfterNormalization, addTemporaryItem, buildInnerString, contains, getContainerType, getRemovedConditionalCompileNode, removeItem, removeTemporaryItem, setContainerType, setRemovedConditionalCompileNode
addChild, addChild, addChildInOrder, addChildPostNormalize, addTemporaryChild, getChild, getChildCount, getInitialChildCount, normalize, removeAllChildren, removeChild, removeTemporaryChild, sortChildren, swapChildren
buildStringRecursive, 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, 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
getAllImportNodes, getAllImports, getScope
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
public 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()
IASNode
public IFileSpecification getFileSpecification()
IASNode
IFileSpecification
that produced this nodegetFileSpecification
in interface IASNode
getFileSpecification
in class NodeBase
public IWorkspace getWorkspace()
NodeBase
IWorkspace
in which this NodeBase
lives.getWorkspace
in class NodeBase
IWorkspace
in which this NodeBase
lives.public void setParent(NodeBase parent)
NodeBase
protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
analyze
in class ScopedBlockNode
public 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 NodeBase
importNodes
- The collection of import nodes being built.public OffsetLookup getOffsetLookup()
getOffsetLookup
in interface IFileNode
public boolean hasIncludes()
hasIncludes
in interface IFileNode
public long getIncludeTreeLastModified()
IFileNode
getIncludeTreeLastModified
in interface IFileNode
public IDefinitionNode[] getTopLevelDefinitionNodes(boolean includeDefinitionsOutsideOfPackage, boolean includeNonPublicDefinitions)
IFileNode
getTopLevelDefinitionNodes
in interface IFileNode
includeDefinitionsOutsideOfPackage
- 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)
IFileNode
getTopLevelDefinitions
in interface IFileNode
includeDefinitionsOutsideOfPackage
- 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)
IFileNode
IFileNode
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 IFileNode
project
- Context project.public Collection<ICompilerProblem> getProblems()
IFileNode
getProblems
in interface IFileNode
ICompilerProblem
objectspublic void addImportNode(IImportNode node)
IFileNodeAccumulator
addImportNode
in interface IFileNodeAccumulator
node
- Node to addpublic List<IImportNode> getImportNodes()
IFileNodeAccumulator
getImportNodes
in interface IFileNodeAccumulator
public void addEmbedNode(IEmbedResolver node)
IFileNodeAccumulator
addEmbedNode
in interface IFileNodeAccumulator
node
- Node to addpublic List<IEmbedResolver> getEmbedNodes()
IFileNodeAccumulator
getEmbedNodes
in interface IFileNodeAccumulator
public void addRequiredResourceBundle(String bundleName)
IFileNodeAccumulator
addRequiredResourceBundle
in interface IFileNodeAccumulator
bundleName
- name of the Resource Bundlepublic Set<String> getRequiredResourceBundles()
getRequiredResourceBundles
in interface IFileNodeAccumulator
public void addDeferredFunctionNode(FunctionNode functionNode)
IFileNodeAccumulator
addDeferredFunctionNode
in interface IFileNodeAccumulator
functionNode
- Function node.public void populateFunctionNodes()
IFileNode
populateFunctionNodes
in interface IFileNode
public 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.