src/attributes/attribute.js

Maintainability

95.28

Lines of code

86

Created with Raphaël 2.1.002550751002019-3-122018-12-32018-8-22018-5-92018-4-32018-2-28

2019-10-30
Maintainability: 95.28

Created with Raphaël 2.1.0022.54567.5902019-3-122018-12-32018-8-22018-5-92018-4-32018-2-28

2019-10-30
Lines of Code: 86

Difficulty

6.73

Estimated Errors

0.10

Function weight

By Complexity

Created with Raphaël 2.1.0<anonymous>1

By SLOC

Created with Raphaël 2.1.0<anonymous>3
1
/**
2
 * @file gpf.attributes.Attribute base class
3
 * @since 0.2.4
4
 */
5
/*#ifndef(UMD)*/
6
"use strict";
7
/*global _gpfDefine*/ // Shortcut for gpf.define
8
/*global _gpfIgnore*/ // Helper to remove unused parameter warning
9
/*exported _gpfAttribute*/ // Shortcut for gpf.attributes.Attribute
10
/*#endif*/
11
 
12
/**
13
 * @namespace gpf.attributes
14
 * @description Root namespace for GPF attributes
15
 * @since 0.2.4
16
 */
17
gpf.attributes = {};
18
 
19
/**
20
 * Base class for all attributes
21
 *
22
 * @class gpf.attributes.Attribute
23
 * @since 0.2.4
24
 */
25
var _gpfAttribute = _gpfDefine({
26
    $class: "gpf.attributes.Attribute",
27
    $abstract: true,
28
 
29
    /**
30
     * Class member name the attribute was set on (or undefined if at class level)
31
     * @type {String|undefined}
32
     * @since 0.2.8
33
     */
34
    _memberName: undefined,
35
 
36
    /**
37
     * @gpf:read _memberName
38
     * @since 0.2.8
39
     */
40
    getMemberName: function () {
41
        return this._memberName;
42
    },
43
 
44
    /**
45
     * Class constructore the attribute was set on
46
     * @type {Function|undefined}
47
     * @since 0.2.8
48
     */
49
    _ClassConstructor: undefined,
50
 
51
    /**
52
     * @gpf:read _ClassConstructor
53
     * @since 0.2.8
54
     */
55
    getClassConstructor: function () {
56
        return this._ClassConstructor;
57
    },
58
 
59
    /**
60
     * Check the attribute usage
61
     * **NOTE**: Experimental feature, do not rely on this method
62
     *
63
     * @param {String} member Member name or empty if global to the class
64
     * @param {_GpfClassDefinition} classDefinition Class definition
65
     * @private
66
     * @since 0.2.8
67
     */
68
    _check: function (member, classDefinition) {
69
        _gpfIgnore(member, classDefinition);
70
    },
71
 
72
    /**
73
     * Build the class according to the attribute usage
74
     * **NOTE**: Experimental feature, do not rely on this method
75
     *
76
     * @param {String} member Member name or empty if global to the class
77
     * @param {_GpfClassDefinition} classDefinition Class definition
78
     * @param {Object} classPrototype Class prototype being built
79
     * @private
80
     * @since 0.2.8
81
     */
82
    _build: function (member, classDefinition, classPrototype) {
83
        _gpfIgnore(member, classDefinition, classPrototype);
84
    }
85
 
86
});