public class DepUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DepUtils.ParseResult |
Constructor and Description |
---|
DepUtils() |
Modifier and Type | Method and Description |
---|---|
static DepTreeNode |
getNodeForResource(URI requestUri,
Map<URI,DepTreeNode> dependencies)
Maps a resource URI to a
DepTreeNode . |
static DepUtils.ParseResult |
parseDependencies(com.google.javascript.rhino.Node node,
Set<String> dependentFeatures)
Walks the parsed AST
Node looking for the AMD define() function
call and extracts the require list of dependencies to a string array and
returns the buildReader. |
static Collection<URI> |
removeRedundantPaths(Collection<URI> uris)
Removes URIs containing duplicate and non-orthogonal paths so that the
collection contains only unique and non-overlapping paths.
|
public static Collection<URI> removeRedundantPaths(Collection<URI> uris)
uris
- collection of URIspublic static DepTreeNode getNodeForResource(URI requestUri, Map<URI,DepTreeNode> dependencies)
DepTreeNode
. This routine finds the key
in dependencies
that is an ancestor of
requiestURI
and then looks for the DepTreeNode
who's
name corresponds to descendant part of the URI path.requestUri
- The URI for the resource location being soughtdependencies
- Map of file path names to root DepTreeNode
srequestURI
public static DepUtils.ParseResult parseDependencies(com.google.javascript.rhino.Node node, Set<String> dependentFeatures)
Node
looking for the AMD define() function
call and extracts the require list of dependencies to a string array and
returns the buildReader.
Any require list entries that are not a string literal (e.g. an object ref) are omitted from the returned array.
node
- A parsed AST Node
for a javascript filedependentFeatures
- Output - any features specified using the has! loader plugin
will be added to this set.Copyright © 2011-2015 IBM. All Rights Reserved.