lfr-amd-loader
Version:
AMD Loader with support for combo URL and conditional loading
1,179 lines (377 loc) • 14.6 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: ConfigParser</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: ConfigParser</h1>
<section>
<header>
<h2>
ConfigParser
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="ConfigParser"><span class="type-signature"></span>new ConfigParser<span class="signature">(<span class="optional">config</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Creates an instance of ConfigurationParser class.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The configuration object to be parsed.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line12">line 12</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="_parseConfig"><span class="type-signature"><protected> </span>_parseConfig<span class="signature">(config)</span><span class="type-signature"> → {object}</span></h4>
</dt>
<dd>
<div class="description">
Parses configuration object.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Configuration object to be parsed.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line134">line 134</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The created configuration
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="_parseModules"><span class="type-signature"><protected> </span>_parseModules<span class="signature">(modules)</span><span class="type-signature"> → {object}</span></h4>
</dt>
<dd>
<div class="description">
Parses a provided modules configuration.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>modules</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Map of modules to be parsed.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line155">line 155</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Map of parsed modules.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="_registerConditionalModule"><span class="type-signature"><protected> </span>_registerConditionalModule<span class="signature">(module)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Registers conditional module to the configuration.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>module</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Module object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line175">line 175</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addModule"><span class="type-signature"></span>addModule<span class="signature">(module)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Adds a module to the configuration.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>module</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The module which should be added to the configuration. Should have the following
properties:
<ul>
<strong>Obligatory properties</strong>:
<li>name (String) The name of the module</li>
<li>dependencies (Array) The modules from which it depends</li>
</ul>
<strong>Optional parameters:</strong>
The same as those which config parameter of <a href="Loader.html#define">Loader#define</a> method accepts.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line37">line 37</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getConditionalModules"><span class="type-signature"></span>getConditionalModules<span class="signature">()</span><span class="type-signature"> → {object}</span></h4>
</dt>
<dd>
<div class="description">
Returns map with all currently registered conditional modules and their triggers.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line71">line 71</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Map with all currently registered conditional modules.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getConfig"><span class="type-signature"></span>getConfig<span class="signature">()</span><span class="type-signature"> → {object}</span></h4>
</dt>
<dd>
<div class="description">
Returns the current configuration.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line62">line 62</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The current configuration.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getModules"><span class="type-signature"></span>getModules<span class="signature">()</span><span class="type-signature"> → {object}</span></h4>
</dt>
<dd>
<div class="description">
Returns map with all currently registered modules.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line80">line 80</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Map with all currently registered modules.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="mapModule"><span class="type-signature"><protected> </span>mapModule<span class="signature">(module)</span><span class="type-signature"> → {array|string}</span></h4>
</dt>
<dd>
<div class="description">
Maps module names to their aliases. Example:
__CONFIG__.maps = {
liferay: 'liferay@1.0.0'
}
When someone does require('liferay/html/js/ac.es',...),
if the module 'liferay/html/js/ac.es' is not defined,
then a corresponding alias will be searched. If found, the name will be replaced,
so it will look like user did require('liferay@1.0.0/html/js/ac.es',...).
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>module</code></td>
<td class="type">
<span class="param-type">array</span>
|
<span class="param-type">string</span>
</td>
<td class="description last">The module which have to be mapped or array of modules.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config-parser.js.html">config-parser.js</a>, <a href="config-parser.js.html#line99">line 99</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The mapped module or array of mapped modules.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array</span>
|
<span class="param-type">string</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ConfigParser.html">ConfigParser</a></li><li><a href="DependencyBuilder.html">DependencyBuilder</a></li><li><a href="EventEmitter.html">EventEmitter</a></li><li><a href="Loader.html">Loader</a></li><li><a href="URLBuilder.html">URLBuilder</a></li></ul><h3>Events</h3><ul><li><a href="Loader.html#event:moduleRegister">moduleRegister</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Tue Jun 16 2015 17:51:36 GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>