diff options
Diffstat (limited to 'node_modules/montage/data/objectid.js')
-rwxr-xr-x | node_modules/montage/data/objectid.js | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/node_modules/montage/data/objectid.js b/node_modules/montage/data/objectid.js new file mode 100755 index 00000000..0c679097 --- /dev/null +++ b/node_modules/montage/data/objectid.js | |||
@@ -0,0 +1,77 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | /** | ||
7 | @module montage/data/objectid | ||
8 | @requires montage/core/core | ||
9 | @requires montage/core/uuid | ||
10 | @requires montage/core/logger | ||
11 | */ | ||
12 | var Montage = require("montage").Montage; | ||
13 | var Uuid = require("core/uuid").Uuid; | ||
14 | var logger = require("core/logger").logger("objectid"); | ||
15 | /** | ||
16 | @class module:montage/data/objectid.ObjectId | ||
17 | @extends module:montage/core/core.Montage | ||
18 | */ | ||
19 | var ObjectId = exports.ObjectId = Montage.create(Montage,/** @lends module:montage/data/objectid.ObjectId# */ { | ||
20 | /** | ||
21 | Description TODO | ||
22 | @type {Property} | ||
23 | @default {Boolean} false | ||
24 | */ | ||
25 | isTemporary: { | ||
26 | value: false | ||
27 | }, | ||
28 | /** | ||
29 | Description TODO | ||
30 | @type {Property} | ||
31 | @default {Object} null | ||
32 | */ | ||
33 | blueprint: { | ||
34 | value: null | ||
35 | } | ||
36 | |||
37 | }); | ||
38 | /** | ||
39 | @class module:montage/data/objectid.TemporaryObjectId | ||
40 | */ | ||
41 | var TemporaryObjectId = exports.TemporaryObjectId = Montage.create(ObjectId,/** @lends module:montage/data/objectid.TemporaryObjectId# */ { | ||
42 | /** | ||
43 | Description TODO | ||
44 | @type {Property} | ||
45 | @default {Boolean} true | ||
46 | */ | ||
47 | isTemporary: { | ||
48 | value: true | ||
49 | }, | ||
50 | /** | ||
51 | Description TODO | ||
52 | @private | ||
53 | */ | ||
54 | _uuid: { | ||
55 | serializable: true, | ||
56 | enumerable: false, | ||
57 | value: null | ||
58 | }, | ||
59 | /** | ||
60 | Description TODO | ||
61 | @function | ||
62 | @returns itself | ||
63 | */ | ||
64 | init: { | ||
65 | serializable: false, | ||
66 | enumerable: false, | ||
67 | value: function() { | ||
68 | this._uuid = Uuid.generate(); | ||
69 | if (logger.isDebug) { | ||
70 | logger.debug(this, "New Temporary Object ID: " + this._uuid); | ||
71 | } | ||
72 | Object.freeze(this); | ||
73 | return this; | ||
74 | } | ||
75 | } | ||
76 | |||
77 | }); | ||