public class DepTree extends Object implements Serializable
define(...)
function call for the AMD module and the list of module
dependencies specified in the define are associated with file.
The mapDependencies(DepTreeRoot, Map, boolean)
function can then be called to obtain a
DepTreeNode
which maps module references to the exploded module
dependencies (the dependencies declared in the module, plus nested
dependencies) for the module.
Modifier and Type | Field and Description |
---|---|
protected String |
cacheBust |
protected ConcurrentMap<URI,DepTreeNode> |
depMap
Map of directory names to
DepTreeNode objects. |
protected boolean |
fromCache |
protected String |
rawConfig |
protected long |
stamp |
Modifier | Constructor and Description |
---|---|
protected |
DepTree()
provided for subclasses
|
|
DepTree(Collection<URI> paths,
IAggregator aggregator,
long stamp,
boolean clean,
boolean validateDeps)
Object constructor.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getNonJSExtensions(IAggregator aggregator)
Returns the set of non-JavaScript file extensions to include in the scanned dependencies name
list.
|
boolean |
isFromCache() |
DepTreeRoot |
mapDependencies(DepTreeRoot root,
Map<String,URI> map,
boolean failIfNoExist)
Returns a new tree with an unnamed
DepTreeNode object at the root
of the tree. |
protected ConcurrentMap<URI,DepTreeNode> depMap
DepTreeNode
objects. Each
DepTreeNode
mirrors the associated file directory in terms of the
directory structure and the javascript files contained therein. The file
directories are orthogonal (i.e. non-overlapping). The
DepTreeNode
objects in this map can specify directory lists using
module names with relative paths and do not contain any resolved
dependency references to any other modules. They only contain the String
array of dependency names for each javascript source file.
This object gets serialized/de-serialized to/from the location specified
by the basedir
constructor argument.
protected String rawConfig
protected long stamp
protected String cacheBust
protected boolean fromCache
protected DepTree()
public DepTree(Collection<URI> paths, IAggregator aggregator, long stamp, boolean clean, boolean validateDeps) throws IOException
paths
- Collection of URIs which specify the target resources
to be scanned for javascript files.aggregator
- The servlet instance for this objectstamp
- timestamp associated with external override/customization
resources that are check on every server restartclean
- If true, then the dependency lists are generated from scratch
rather than by de-serializing and then validating the cached
dependency lists.validateDeps
- If true, then validate existing cached dependencies using
file last-modified times.IOException
public boolean isFromCache()
public DepTreeRoot mapDependencies(DepTreeRoot root, Map<String,URI> map, boolean failIfNoExist)
DepTreeNode
object at the root
of the tree. Each of the keys specified in the map are children of the
returned node and those node's children are the children of the nodes
corresponding to the resource URIs specified by the map values.
The map values must be the same as, or a subset of, the paths that
were used to create this instance.root
- The root tree nodemap
- A map of module names to resource URIsfailIfNoExist
- if true, then an IllegalStateException
is thrown if
any of the resources in map
don't existDepTreeNode
for the new treepublic Set<String> getNonJSExtensions(IAggregator aggregator)
IDependencies.defaultNonJSExtensions
IDependencies.nonJSExtensionsCfgPropName
config propertyIModuleBuilderExtensionPoint.EXTENSION_ATTRIBUTE
config
property for the registered module buildersaggregator
- the aggregator instanceCopyright © 2011-2015 IBM. All Rights Reserved.