[JSDoc] Add annotations
Bulk-add JSDoc annotations, WTD-1482.
This commit is contained in:
@@ -32,6 +32,8 @@ define(
|
||||
* which capabilities. This supports composition policy (rules
|
||||
* for which objects can contain which other objects) which
|
||||
* sometimes is determined based on the presence of capabilities.
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
*/
|
||||
function CapabilityTable(typeService, capabilityService) {
|
||||
var table = {};
|
||||
@@ -64,6 +66,7 @@ define(
|
||||
/**
|
||||
* Check if a type is expected to expose a specific
|
||||
* capability.
|
||||
* @memberof platform/containment.CapabilityTable#
|
||||
*/
|
||||
hasCapability: function (typeKey, capabilityKey) {
|
||||
return (table[capabilityKey] || {})[typeKey];
|
||||
@@ -73,4 +76,4 @@ define(
|
||||
|
||||
return CapabilityTable;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -34,6 +34,8 @@ define(
|
||||
* since it's delegated to a different policy category.
|
||||
* To avoid a circular dependency, the service is obtained via
|
||||
* Angular's `$injector`.
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
*/
|
||||
function ComposeActionPolicy($injector) {
|
||||
var policyService;
|
||||
@@ -61,6 +63,7 @@ define(
|
||||
* Check whether or not a compose action should be allowed
|
||||
* in this context.
|
||||
* @returns {boolean} true if it may be allowed
|
||||
* @memberof platform/containment.ComposeActionPolicy#
|
||||
*/
|
||||
allow: function (candidate, context) {
|
||||
if (candidate.getMetadata().key === 'compose') {
|
||||
@@ -77,4 +80,4 @@ define(
|
||||
return ComposeActionPolicy;
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -8,12 +8,15 @@ define(
|
||||
/**
|
||||
* Policy allowing composition only for domain object types which
|
||||
* have a composition property.
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
*/
|
||||
function CompositionModelPolicy() {
|
||||
return {
|
||||
/**
|
||||
* Is the type identified by the candidate allowed to
|
||||
* contain the type described by the context?
|
||||
* @memberof platform/containment.CompositionModelPolicy#
|
||||
*/
|
||||
allow: function (candidate, context) {
|
||||
return Array.isArray(
|
||||
@@ -25,4 +28,4 @@ define(
|
||||
|
||||
return CompositionModelPolicy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -28,6 +28,7 @@ define(
|
||||
|
||||
/**
|
||||
* Disallow composition changes to objects which are not mutable.
|
||||
* @memberof platform/containment
|
||||
* @constructor
|
||||
*/
|
||||
function CompositionMutabilityPolicy() {
|
||||
@@ -36,6 +37,7 @@ define(
|
||||
* Is the type identified by the candidate allowed to
|
||||
* contain the type described by the context?
|
||||
* @param {Type} candidate the type of domain object
|
||||
* @memberof platform/containment.CompositionMutabilityPolicy#
|
||||
*/
|
||||
allow: function (candidate) {
|
||||
// Equate creatability with mutability; that is, users
|
||||
@@ -48,4 +50,4 @@ define(
|
||||
|
||||
return CompositionMutabilityPolicy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -28,6 +28,8 @@ define(
|
||||
|
||||
/**
|
||||
* Defines composition policy as driven by type metadata.
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
*/
|
||||
function CompositionPolicy($injector) {
|
||||
// We're really just wrapping the containment table and rephrasing
|
||||
@@ -45,6 +47,7 @@ define(
|
||||
/**
|
||||
* Is the type identified by the candidate allowed to
|
||||
* contain the type described by the context?
|
||||
* @memberof platform/containment.CompositionPolicy#
|
||||
*/
|
||||
allow: function (candidate, context) {
|
||||
return getTable().canContain(candidate, context);
|
||||
@@ -54,4 +57,4 @@ define(
|
||||
|
||||
return CompositionPolicy;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -37,6 +37,8 @@ define(
|
||||
* start time (plug-in support means this cannot be determined
|
||||
* prior to that, but we don't want to redo these calculations
|
||||
* every time policy is checked.)
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
*/
|
||||
function ContainmentTable(typeService, capabilityService) {
|
||||
var types = typeService.listTypes(),
|
||||
@@ -103,6 +105,7 @@ define(
|
||||
* Check if domain objects of one type can contain domain
|
||||
* objects of another type.
|
||||
* @returns {boolean} true if allowable
|
||||
* @memberof platform/containment.ContainmentTable#
|
||||
*/
|
||||
canContain: function (containerType, containedType) {
|
||||
var set = table[containerType.getKey()] || {};
|
||||
@@ -116,4 +119,4 @@ define(
|
||||
|
||||
return ContainmentTable;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user