@itwin/ecschema-metadata 5.0.0-dev.10 → 5.0.0-dev.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -1
- package/lib/cjs/Constants.d.ts +8 -0
- package/lib/cjs/Constants.d.ts.map +1 -1
- package/lib/cjs/Constants.js +30 -21
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Context.d.ts +83 -34
- package/lib/cjs/Context.d.ts.map +1 -1
- package/lib/cjs/Context.js +73 -23
- package/lib/cjs/Context.js.map +1 -1
- package/lib/cjs/DelayedPromise.js +6 -4
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js +1 -0
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts +3 -3
- package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
- package/lib/cjs/Deserialization/Helper.js +8 -0
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js +3 -0
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +14 -0
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js +11 -3
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +2 -6
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js +1 -0
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +21 -1
- package/lib/cjs/ECObjects.d.ts.map +1 -1
- package/lib/cjs/ECObjects.js +33 -2
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.js +1 -0
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +10 -3
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +83 -21
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +188 -63
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +14 -1
- package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
- package/lib/cjs/Metadata/Constant.js +27 -2
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +16 -4
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +22 -4
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +20 -8
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +43 -23
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts +14 -1
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js +22 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +41 -1
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js +68 -3
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +8 -3
- package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js +17 -6
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +14 -3
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +43 -18
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +15 -1
- package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
- package/lib/cjs/Metadata/Mixin.js +23 -2
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +9 -0
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +14 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js +22 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts +5 -1
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +83 -28
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +14 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js +21 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +15 -2
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +47 -10
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +117 -13
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +148 -70
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +11 -2
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +12 -2
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.d.ts +8 -1
- package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
- package/lib/cjs/Metadata/Unit.js +21 -3
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +14 -3
- package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js +21 -3
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.d.ts +3 -3
- package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js +3 -3
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.d.ts +7 -1
- package/lib/cjs/SchemaKey.d.ts.map +1 -1
- package/lib/cjs/SchemaKey.js +13 -3
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +2 -2
- package/lib/cjs/SchemaLoader.d.ts.map +1 -1
- package/lib/cjs/SchemaLoader.js +1 -0
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js +1 -0
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.js +69 -65
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js +9 -7
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js +2 -0
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.d.ts +2 -0
- package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js +11 -1
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js +8 -9
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js +6 -4
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +1 -1
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js +2 -3
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.d.ts +8 -0
- package/lib/esm/Constants.d.ts.map +1 -1
- package/lib/esm/Constants.js +29 -20
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Context.d.ts +83 -34
- package/lib/esm/Context.d.ts.map +1 -1
- package/lib/esm/Context.js +71 -21
- package/lib/esm/Context.js.map +1 -1
- package/lib/esm/DelayedPromise.js +6 -4
- package/lib/esm/DelayedPromise.js.map +1 -1
- package/lib/esm/Deserialization/AbstractParser.js +1 -0
- package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
- package/lib/esm/Deserialization/Helper.d.ts +3 -3
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
- package/lib/esm/Deserialization/Helper.js +8 -0
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js +3 -0
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/JsonProps.d.ts +14 -0
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/esm/Deserialization/JsonProps.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js +11 -3
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +2 -6
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECName.js +1 -0
- package/lib/esm/ECName.js.map +1 -1
- package/lib/esm/ECObjects.d.ts +21 -1
- package/lib/esm/ECObjects.d.ts.map +1 -1
- package/lib/esm/ECObjects.js +31 -1
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/Exception.js +1 -0
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +10 -3
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +83 -21
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +189 -64
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Constant.d.ts +14 -1
- package/lib/esm/Metadata/Constant.d.ts.map +1 -1
- package/lib/esm/Metadata/Constant.js +27 -2
- package/lib/esm/Metadata/Constant.js.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +16 -4
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +22 -4
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +20 -8
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +43 -23
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Enumeration.d.ts +14 -1
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/esm/Metadata/Enumeration.js +22 -1
- package/lib/esm/Metadata/Enumeration.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +41 -1
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js +68 -3
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.d.ts +8 -3
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.js +17 -6
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.d.ts +14 -3
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +43 -18
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Mixin.d.ts +15 -1
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
- package/lib/esm/Metadata/Mixin.js +24 -3
- package/lib/esm/Metadata/Mixin.js.map +1 -1
- package/lib/esm/Metadata/OverrideFormat.js +9 -0
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts +14 -1
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/esm/Metadata/Phenomenon.js +22 -1
- package/lib/esm/Metadata/Phenomenon.js.map +1 -1
- package/lib/esm/Metadata/Property.d.ts +5 -1
- package/lib/esm/Metadata/Property.d.ts.map +1 -1
- package/lib/esm/Metadata/Property.js +84 -29
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts +14 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.js +21 -1
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts +15 -2
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +48 -11
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
- package/lib/esm/Metadata/Schema.d.ts +117 -13
- package/lib/esm/Metadata/Schema.d.ts.map +1 -1
- package/lib/esm/Metadata/Schema.js +148 -70
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.d.ts +11 -2
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +13 -3
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/Metadata/Unit.d.ts +8 -1
- package/lib/esm/Metadata/Unit.d.ts.map +1 -1
- package/lib/esm/Metadata/Unit.js +21 -3
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/Metadata/UnitSystem.d.ts +14 -3
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/esm/Metadata/UnitSystem.js +21 -3
- package/lib/esm/Metadata/UnitSystem.js.map +1 -1
- package/lib/esm/SchemaJsonLocater.d.ts +3 -3
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/esm/SchemaJsonLocater.js +3 -3
- package/lib/esm/SchemaJsonLocater.js.map +1 -1
- package/lib/esm/SchemaKey.d.ts +7 -1
- package/lib/esm/SchemaKey.d.ts.map +1 -1
- package/lib/esm/SchemaKey.js +13 -3
- package/lib/esm/SchemaKey.js.map +1 -1
- package/lib/esm/SchemaLoader.d.ts +2 -2
- package/lib/esm/SchemaLoader.d.ts.map +1 -1
- package/lib/esm/SchemaLoader.js +1 -0
- package/lib/esm/SchemaLoader.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/UnitConversion/Graph.js +69 -65
- package/lib/esm/UnitConversion/Graph.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitConversion.js +9 -7
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConverter.js +2 -0
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.d.ts +2 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.js +11 -1
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +8 -9
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/esm/Validation/SchemaWalker.js +6 -4
- package/lib/esm/Validation/SchemaWalker.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +1 -1
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/lib/esm/utils/SchemaGraph.js +2 -3
- package/lib/esm/utils/SchemaGraph.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAiD,eAAe,EAA0C,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE9L,OAAO,EAAE,QAAQ,EAAa,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,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AAE,aAAa,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ;aAE9G,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;aAC7F,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc;aAExF,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;aACvG,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,mBAAmB;aAElG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aAC3C,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAChE"}
|
|
@@ -15,6 +15,7 @@ const ECObjects_1 = require("../ECObjects");
|
|
|
15
15
|
const Exception_1 = require("../Exception");
|
|
16
16
|
const SchemaKey_1 = require("../SchemaKey");
|
|
17
17
|
const CustomAttribute_1 = require("./CustomAttribute");
|
|
18
|
+
const Enumeration_1 = require("./Enumeration");
|
|
18
19
|
const Property_1 = require("./Property");
|
|
19
20
|
const SchemaItem_1 = require("./SchemaItem");
|
|
20
21
|
const Helper_1 = require("../Deserialization/Helper");
|
|
@@ -23,10 +24,14 @@ const Helper_1 = require("../Deserialization/Helper");
|
|
|
23
24
|
* @beta
|
|
24
25
|
*/
|
|
25
26
|
class ECClass extends SchemaItem_1.SchemaItem {
|
|
27
|
+
static get schemaItemType() { return ECObjects_1.AbstractSchemaItemType.Class; } // need this so getItem("name", ECClass) in schema works
|
|
28
|
+
_modifier;
|
|
29
|
+
_baseClass;
|
|
30
|
+
_derivedClasses;
|
|
31
|
+
_properties;
|
|
32
|
+
_customAttributes;
|
|
33
|
+
_mergedPropertyCache;
|
|
26
34
|
get modifier() { return this._modifier; }
|
|
27
|
-
get baseClass() { return this._baseClass; }
|
|
28
|
-
set baseClass(baseClass) { this._baseClass = baseClass; }
|
|
29
|
-
get properties() { return this._properties?.values(); }
|
|
30
35
|
get customAttributes() { return this._customAttributes; }
|
|
31
36
|
constructor(schema, name, modifier) {
|
|
32
37
|
super(schema, name);
|
|
@@ -35,6 +40,32 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
35
40
|
else
|
|
36
41
|
this._modifier = ECObjects_1.ECClassModifier.None;
|
|
37
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets the base class if it exists, otherwise returns undefined.
|
|
45
|
+
*/
|
|
46
|
+
get baseClass() {
|
|
47
|
+
return this._baseClass;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets the base class of the ECClass. Pass undefined to 'remove' the base class.
|
|
51
|
+
*/
|
|
52
|
+
async setBaseClass(baseClass) {
|
|
53
|
+
const oldBaseClass = this._baseClass;
|
|
54
|
+
this._baseClass = baseClass;
|
|
55
|
+
if (baseClass)
|
|
56
|
+
this.addDerivedClass(await baseClass, this);
|
|
57
|
+
else if (oldBaseClass)
|
|
58
|
+
this.removeDerivedClass(await oldBaseClass, this);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the derived classes belonging to this class.
|
|
62
|
+
* @returns An array of ECClasses or undefined if no derived classes exist.
|
|
63
|
+
*/
|
|
64
|
+
async getDerivedClasses() {
|
|
65
|
+
if (!this._derivedClasses || this._derivedClasses.size === 0)
|
|
66
|
+
return undefined;
|
|
67
|
+
return Array.from(await Promise.all(this._derivedClasses.values()));
|
|
68
|
+
}
|
|
38
69
|
/**
|
|
39
70
|
* Convenience method for adding an already loaded ECProperty used by create*Property methods.
|
|
40
71
|
* @param prop The property to add.
|
|
@@ -44,6 +75,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
44
75
|
if (!this._properties)
|
|
45
76
|
this._properties = new Map();
|
|
46
77
|
this._properties.set(prop.name.toUpperCase(), prop);
|
|
78
|
+
this.cleanCache();
|
|
47
79
|
return prop;
|
|
48
80
|
}
|
|
49
81
|
/**
|
|
@@ -54,8 +86,10 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
54
86
|
async deleteProperty(name) {
|
|
55
87
|
if (this._properties) {
|
|
56
88
|
const property = await this.getProperty(name);
|
|
57
|
-
if (property)
|
|
89
|
+
if (property) {
|
|
58
90
|
this._properties.delete(name.toUpperCase());
|
|
91
|
+
this.cleanCache();
|
|
92
|
+
}
|
|
59
93
|
}
|
|
60
94
|
}
|
|
61
95
|
/**
|
|
@@ -66,44 +100,49 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
66
100
|
deletePropertySync(name) {
|
|
67
101
|
if (this._properties) {
|
|
68
102
|
const property = this.getPropertySync(name);
|
|
69
|
-
if (property)
|
|
103
|
+
if (property) {
|
|
70
104
|
this._properties.delete(name.toUpperCase());
|
|
105
|
+
this.cleanCache();
|
|
106
|
+
}
|
|
71
107
|
}
|
|
72
108
|
}
|
|
73
109
|
getBaseClassSync() {
|
|
74
110
|
if (!this.baseClass) {
|
|
75
111
|
return undefined;
|
|
76
112
|
}
|
|
77
|
-
return this.schema.lookupItemSync(this.baseClass);
|
|
113
|
+
return this.schema.lookupItemSync(this.baseClass, ECClass);
|
|
78
114
|
}
|
|
79
115
|
/**
|
|
80
|
-
* Searches, case-insensitive, for
|
|
81
|
-
*
|
|
116
|
+
* Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on
|
|
117
|
+
* all base classes. Set excludeInherited to 'true' to only search the local class.
|
|
118
|
+
* @param name The name of the property to retrieve.
|
|
119
|
+
* @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.
|
|
82
120
|
*/
|
|
83
|
-
async getProperty(name,
|
|
121
|
+
async getProperty(name, excludeInherited = false) {
|
|
84
122
|
if (this._properties) {
|
|
85
123
|
const upperKey = name.toUpperCase();
|
|
86
124
|
const property = this._properties.get(upperKey);
|
|
87
125
|
if (property)
|
|
88
126
|
return property;
|
|
89
127
|
}
|
|
90
|
-
if (
|
|
128
|
+
if (excludeInherited) {
|
|
91
129
|
return undefined;
|
|
92
130
|
}
|
|
93
131
|
return this.getInheritedProperty(name);
|
|
94
132
|
}
|
|
95
133
|
/**
|
|
96
134
|
* Searches, case-insensitive, for a local ECProperty with the name provided.
|
|
97
|
-
* @param name
|
|
135
|
+
* @param name The name of the property to retrieve.
|
|
136
|
+
* @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.
|
|
98
137
|
*/
|
|
99
|
-
getPropertySync(name,
|
|
138
|
+
getPropertySync(name, excludeInherited = false) {
|
|
100
139
|
if (this._properties) {
|
|
101
140
|
const upperKey = name.toUpperCase();
|
|
102
141
|
const property = this._properties.get(upperKey);
|
|
103
142
|
if (property)
|
|
104
143
|
return property;
|
|
105
144
|
}
|
|
106
|
-
if (
|
|
145
|
+
if (excludeInherited) {
|
|
107
146
|
return undefined;
|
|
108
147
|
}
|
|
109
148
|
return this.getInheritedPropertySync(name);
|
|
@@ -115,7 +154,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
115
154
|
async getInheritedProperty(name) {
|
|
116
155
|
if (this.baseClass) {
|
|
117
156
|
const baseClassObj = await this.baseClass;
|
|
118
|
-
return baseClassObj.getProperty(name
|
|
157
|
+
return baseClassObj.getProperty(name);
|
|
119
158
|
}
|
|
120
159
|
return undefined;
|
|
121
160
|
}
|
|
@@ -126,11 +165,11 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
126
165
|
getInheritedPropertySync(name) {
|
|
127
166
|
const baseClassObj = this.getBaseClassSync();
|
|
128
167
|
if (baseClassObj)
|
|
129
|
-
return baseClassObj.getPropertySync(name
|
|
168
|
+
return baseClassObj.getPropertySync(name);
|
|
130
169
|
return undefined;
|
|
131
170
|
}
|
|
132
171
|
async createPrimitiveProperty(name, primitiveType) {
|
|
133
|
-
if (await this.getProperty(name))
|
|
172
|
+
if (await this.getProperty(name, true))
|
|
134
173
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
135
174
|
const propType = await this.loadPrimitiveType(primitiveType, this.schema);
|
|
136
175
|
if (typeof (propType) === "number")
|
|
@@ -138,7 +177,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
138
177
|
return this.addProperty(new Property_1.EnumerationProperty(this, name, new DelayedPromise_1.DelayedPromiseWithProps(propType.key, async () => propType)));
|
|
139
178
|
}
|
|
140
179
|
createPrimitivePropertySync(name, primitiveType) {
|
|
141
|
-
if (this.getPropertySync(name))
|
|
180
|
+
if (this.getPropertySync(name, true))
|
|
142
181
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
143
182
|
const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);
|
|
144
183
|
if (typeof (propType) === "number")
|
|
@@ -146,7 +185,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
146
185
|
return this.addProperty(new Property_1.EnumerationProperty(this, name, new DelayedPromise_1.DelayedPromiseWithProps(propType.key, async () => propType)));
|
|
147
186
|
}
|
|
148
187
|
async createPrimitiveArrayProperty(name, primitiveType) {
|
|
149
|
-
if (await this.getProperty(name))
|
|
188
|
+
if (await this.getProperty(name, true))
|
|
150
189
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
151
190
|
const propType = await this.loadPrimitiveType(primitiveType, this.schema);
|
|
152
191
|
if (typeof (propType) === "number")
|
|
@@ -154,7 +193,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
154
193
|
return this.addProperty(new Property_1.EnumerationArrayProperty(this, name, new DelayedPromise_1.DelayedPromiseWithProps(propType.key, async () => propType)));
|
|
155
194
|
}
|
|
156
195
|
createPrimitiveArrayPropertySync(name, primitiveType) {
|
|
157
|
-
if (this.getPropertySync(name))
|
|
196
|
+
if (this.getPropertySync(name, true))
|
|
158
197
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
159
198
|
const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);
|
|
160
199
|
if (typeof (propType) === "number")
|
|
@@ -167,7 +206,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
167
206
|
* @param structType The struct type of property to create.
|
|
168
207
|
*/
|
|
169
208
|
async createStructProperty(name, structType) {
|
|
170
|
-
if (await this.getProperty(name))
|
|
209
|
+
if (await this.getProperty(name, true))
|
|
171
210
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
172
211
|
return this.addProperty(new Property_1.StructProperty(this, name, await this.loadStructType(structType, this.schema)));
|
|
173
212
|
}
|
|
@@ -177,7 +216,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
177
216
|
* @param structType The struct type of property to create.
|
|
178
217
|
*/
|
|
179
218
|
createStructPropertySync(name, structType) {
|
|
180
|
-
if (this.getPropertySync(name))
|
|
219
|
+
if (this.getPropertySync(name, true))
|
|
181
220
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
182
221
|
return this.addProperty(new Property_1.StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));
|
|
183
222
|
}
|
|
@@ -187,7 +226,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
187
226
|
* @param type
|
|
188
227
|
*/
|
|
189
228
|
async createStructArrayProperty(name, structType) {
|
|
190
|
-
if (await this.getProperty(name))
|
|
229
|
+
if (await this.getProperty(name, true))
|
|
191
230
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
192
231
|
return this.addProperty(new Property_1.StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));
|
|
193
232
|
}
|
|
@@ -197,14 +236,14 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
197
236
|
* @param type
|
|
198
237
|
*/
|
|
199
238
|
createStructArrayPropertySync(name, structType) {
|
|
200
|
-
if (this.getPropertySync(name))
|
|
239
|
+
if (this.getPropertySync(name, true))
|
|
201
240
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);
|
|
202
241
|
return this.addProperty(new Property_1.StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));
|
|
203
242
|
}
|
|
204
243
|
async loadStructType(structType, schema) {
|
|
205
244
|
let correctType;
|
|
206
245
|
if (typeof (structType) === "string") {
|
|
207
|
-
correctType = await schema.lookupItem(structType);
|
|
246
|
+
correctType = await schema.lookupItem(structType, StructClass);
|
|
208
247
|
}
|
|
209
248
|
else
|
|
210
249
|
correctType = structType;
|
|
@@ -215,7 +254,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
215
254
|
loadStructTypeSync(structType, schema) {
|
|
216
255
|
let correctType;
|
|
217
256
|
if (typeof (structType) === "string") {
|
|
218
|
-
correctType = schema.lookupItemSync(structType);
|
|
257
|
+
correctType = schema.lookupItemSync(structType, StructClass);
|
|
219
258
|
}
|
|
220
259
|
else
|
|
221
260
|
correctType = structType;
|
|
@@ -229,7 +268,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
229
268
|
if (typeof (primitiveType) === "string") {
|
|
230
269
|
let resolvedType = (0, ECObjects_1.parsePrimitiveType)(primitiveType);
|
|
231
270
|
if (!resolvedType) {
|
|
232
|
-
resolvedType = await schema.lookupItem(primitiveType);
|
|
271
|
+
resolvedType = await schema.lookupItem(primitiveType, Enumeration_1.Enumeration);
|
|
233
272
|
}
|
|
234
273
|
if (resolvedType === undefined)
|
|
235
274
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);
|
|
@@ -246,7 +285,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
246
285
|
if (typeof (primitiveType) === "string") {
|
|
247
286
|
let resolvedType = (0, ECObjects_1.parsePrimitiveType)(primitiveType);
|
|
248
287
|
if (!resolvedType) {
|
|
249
|
-
resolvedType = schema.lookupItemSync(primitiveType);
|
|
288
|
+
resolvedType = schema.lookupItemSync(primitiveType, Enumeration_1.Enumeration);
|
|
250
289
|
}
|
|
251
290
|
if (resolvedType === undefined)
|
|
252
291
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);
|
|
@@ -268,7 +307,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
268
307
|
if (this.baseClass !== undefined)
|
|
269
308
|
schemaJson.baseClass = this.baseClass.fullName;
|
|
270
309
|
if (this._properties !== undefined && this._properties.size > 0)
|
|
271
|
-
schemaJson.properties = [...this.
|
|
310
|
+
schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());
|
|
272
311
|
const customAttributes = (0, CustomAttribute_1.serializeCustomAttributes)(this.customAttributes);
|
|
273
312
|
if (customAttributes !== undefined)
|
|
274
313
|
schemaJson.customAttributes = customAttributes;
|
|
@@ -286,8 +325,8 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
286
325
|
baseClassElement.textContent = baseClassName;
|
|
287
326
|
itemElement.appendChild(baseClassElement);
|
|
288
327
|
}
|
|
289
|
-
if (undefined !== this.
|
|
290
|
-
for (const prop of this.
|
|
328
|
+
if (undefined !== this._properties) {
|
|
329
|
+
for (const prop of this._properties.values()) {
|
|
291
330
|
const propXml = await prop.toXml(schemaXml);
|
|
292
331
|
itemElement.appendChild(propXml);
|
|
293
332
|
}
|
|
@@ -320,12 +359,25 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
320
359
|
const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);
|
|
321
360
|
if (!ecClassSchemaItemKey)
|
|
322
361
|
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
362
|
+
const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);
|
|
363
|
+
let lazyBase;
|
|
364
|
+
if (!baseClass) {
|
|
365
|
+
lazyBase = new DelayedPromise_1.DelayedPromiseWithProps(ecClassSchemaItemKey, async () => {
|
|
366
|
+
const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);
|
|
367
|
+
if (undefined === baseItem || !ECClass.isECClass(baseItem))
|
|
368
|
+
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);
|
|
369
|
+
return baseItem;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
lazyBase = new DelayedPromise_1.DelayedPromiseWithProps(ecClassSchemaItemKey, async () => {
|
|
374
|
+
return baseClass;
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
this._baseClass = lazyBase;
|
|
378
|
+
if (!baseClass)
|
|
379
|
+
return;
|
|
380
|
+
this.addDerivedClass(baseClass, this);
|
|
329
381
|
}
|
|
330
382
|
}
|
|
331
383
|
async fromJSON(classProps) {
|
|
@@ -344,8 +396,8 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
344
396
|
const baseClasses = [this];
|
|
345
397
|
const addBaseClasses = async (ecClass) => {
|
|
346
398
|
if (ECObjects_1.SchemaItemType.EntityClass === ecClass.schemaItemType) {
|
|
347
|
-
for (let i =
|
|
348
|
-
baseClasses.push(await
|
|
399
|
+
for (let i = ecClass.mixins.length - 1; i >= 0; i--) {
|
|
400
|
+
baseClasses.push(await ecClass.mixins[i]);
|
|
349
401
|
}
|
|
350
402
|
}
|
|
351
403
|
if (ecClass.baseClass)
|
|
@@ -361,7 +413,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
361
413
|
*getAllBaseClassesSync() {
|
|
362
414
|
const baseClasses = [this];
|
|
363
415
|
const addBaseClasses = (ecClass) => {
|
|
364
|
-
if (ECObjects_1.SchemaItemType.EntityClass
|
|
416
|
+
if (ecClass.schemaItemType === ECObjects_1.SchemaItemType.EntityClass) { // cannot use EntityClass typeguard because of circular reference
|
|
365
417
|
for (const m of Array.from(ecClass.getMixinsSync()).reverse()) {
|
|
366
418
|
baseClasses.push(m);
|
|
367
419
|
}
|
|
@@ -392,52 +444,71 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
392
444
|
}
|
|
393
445
|
}
|
|
394
446
|
}
|
|
395
|
-
async buildPropertyCache(result, existingValues
|
|
447
|
+
async buildPropertyCache(result, existingValues) {
|
|
396
448
|
if (!existingValues) {
|
|
397
449
|
existingValues = new Map();
|
|
398
450
|
}
|
|
399
451
|
if (this.baseClass) {
|
|
400
|
-
|
|
452
|
+
const baseClass = await this.baseClass;
|
|
453
|
+
if (baseClass) {
|
|
454
|
+
ECClass.mergeProperties(result, existingValues, await baseClass.getProperties(), false);
|
|
455
|
+
}
|
|
401
456
|
}
|
|
402
|
-
if (!this.
|
|
457
|
+
if (!this._properties)
|
|
403
458
|
return;
|
|
404
|
-
ECClass.mergeProperties(result, existingValues, [...this.
|
|
459
|
+
ECClass.mergeProperties(result, existingValues, [...this._properties.values()], true);
|
|
405
460
|
}
|
|
406
|
-
buildPropertyCacheSync(result, existingValues
|
|
461
|
+
buildPropertyCacheSync(result, existingValues) {
|
|
407
462
|
if (!existingValues) {
|
|
408
463
|
existingValues = new Map();
|
|
409
464
|
}
|
|
410
465
|
const baseClass = this.getBaseClassSync();
|
|
411
466
|
if (baseClass) {
|
|
412
|
-
ECClass.mergeProperties(result, existingValues, baseClass.getPropertiesSync(
|
|
467
|
+
ECClass.mergeProperties(result, existingValues, baseClass.getPropertiesSync(), false);
|
|
413
468
|
}
|
|
414
|
-
if (!this.
|
|
469
|
+
if (!this._properties)
|
|
415
470
|
return;
|
|
416
|
-
ECClass.mergeProperties(result, existingValues, [...this.
|
|
471
|
+
ECClass.mergeProperties(result, existingValues, [...this._properties.values()], true);
|
|
417
472
|
}
|
|
418
473
|
/**
|
|
419
|
-
*
|
|
474
|
+
* Clears all caches on this object. This is called implicitly for this class,
|
|
475
|
+
* but needs to be called if derived classes have changed.
|
|
476
|
+
* @internal
|
|
477
|
+
*/
|
|
478
|
+
cleanCache() {
|
|
479
|
+
this._mergedPropertyCache = undefined;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Returns the properties on this class and its base classes.
|
|
420
483
|
* Since this is an expensive operation, results will be cached after first call.
|
|
421
|
-
* @param
|
|
484
|
+
* @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.
|
|
485
|
+
* @returns An array of properties, empty array if none exist.
|
|
422
486
|
*/
|
|
423
|
-
getPropertiesSync(
|
|
424
|
-
if (
|
|
487
|
+
getPropertiesSync(excludeInherited) {
|
|
488
|
+
if (excludeInherited) {
|
|
489
|
+
return this._properties && this._properties.size > 0 ? this._properties.values() : [];
|
|
490
|
+
}
|
|
491
|
+
if (!this._mergedPropertyCache) {
|
|
425
492
|
this._mergedPropertyCache = [];
|
|
426
|
-
this.buildPropertyCacheSync(this._mergedPropertyCache, undefined
|
|
493
|
+
this.buildPropertyCacheSync(this._mergedPropertyCache, undefined);
|
|
427
494
|
}
|
|
428
495
|
return this._mergedPropertyCache;
|
|
429
496
|
}
|
|
430
497
|
/**
|
|
431
|
-
*
|
|
498
|
+
* Quick way to check whether this class has any local properties without having to use the iterable
|
|
499
|
+
*/
|
|
500
|
+
get hasLocalProperties() {
|
|
501
|
+
return this._properties !== undefined && this._properties.size > 0;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Returns the properties on this class and its base classes.
|
|
432
505
|
* Since this is an expensive operation, results will be cached after first call.
|
|
433
|
-
* @param
|
|
506
|
+
* @param excludeInherited If true, only properties defined directly on this class will be returned.
|
|
507
|
+
* @returns An array of properties, empty array if none exist.
|
|
434
508
|
*/
|
|
435
|
-
async getProperties(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
await this.buildPropertyCache(this._mergedPropertyCache, undefined, resetCache);
|
|
439
|
-
}
|
|
440
|
-
return this._mergedPropertyCache;
|
|
509
|
+
async getProperties(excludeInherited) {
|
|
510
|
+
// At the moment we do not lazy load properties, so this is the same as getPropertiesSync
|
|
511
|
+
return this.getPropertiesSync(excludeInherited);
|
|
441
512
|
}
|
|
442
513
|
/**
|
|
443
514
|
* Retrieve all custom attributes in the current class and its bases
|
|
@@ -536,6 +607,35 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
536
607
|
setModifier(modifier) {
|
|
537
608
|
this._modifier = modifier;
|
|
538
609
|
}
|
|
610
|
+
/**
|
|
611
|
+
* Adds an ECClass to the derived class collection. This method is only intended to update the local
|
|
612
|
+
* cache of derived classes. For adding a class to the hierarchy, use the baseClass setter method.
|
|
613
|
+
* @param prop The property to add.
|
|
614
|
+
* @return The property that was added.
|
|
615
|
+
*/
|
|
616
|
+
addDerivedClass(baseClass, derivedClass) {
|
|
617
|
+
if (!baseClass._derivedClasses)
|
|
618
|
+
baseClass._derivedClasses = new Map();
|
|
619
|
+
if (baseClass._derivedClasses.has(derivedClass.fullName))
|
|
620
|
+
return;
|
|
621
|
+
if (derivedClass.isSync(baseClass)) {
|
|
622
|
+
const promise = new DelayedPromise_1.DelayedPromiseWithProps(derivedClass.key, async () => derivedClass);
|
|
623
|
+
baseClass._derivedClasses.set(derivedClass.fullName, promise);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Removes an ECClass from the derived class collection. This method is only intended to update the local
|
|
628
|
+
* cache of derived classes. For updating the class hierarchy, use the baseClass setter method.
|
|
629
|
+
* @param prop The property to add.
|
|
630
|
+
* @return The property that was added.
|
|
631
|
+
*/
|
|
632
|
+
removeDerivedClass(baseClass, derivedClass) {
|
|
633
|
+
if (!baseClass._derivedClasses)
|
|
634
|
+
return;
|
|
635
|
+
if (!baseClass._derivedClasses.has(derivedClass.fullName))
|
|
636
|
+
return;
|
|
637
|
+
baseClass._derivedClasses.delete(derivedClass.fullName);
|
|
638
|
+
}
|
|
539
639
|
}
|
|
540
640
|
exports.ECClass = ECClass;
|
|
541
641
|
/**
|
|
@@ -543,9 +643,34 @@ exports.ECClass = ECClass;
|
|
|
543
643
|
* @beta
|
|
544
644
|
*/
|
|
545
645
|
class StructClass extends ECClass {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
646
|
+
/**
|
|
647
|
+
* Get the type of item represented by this instance
|
|
648
|
+
* @beta
|
|
649
|
+
*/
|
|
650
|
+
schemaItemType = StructClass.schemaItemType;
|
|
651
|
+
/**
|
|
652
|
+
* Get the type of item represented by this class
|
|
653
|
+
* @beta
|
|
654
|
+
*/
|
|
655
|
+
static get schemaItemType() { return ECObjects_1.SchemaItemType.StructClass; }
|
|
656
|
+
/**
|
|
657
|
+
* Type guard to check if the SchemaItem is of type StructClass.
|
|
658
|
+
* @param item The SchemaItem to check.
|
|
659
|
+
* @returns True if the item is a StructClass, false otherwise.
|
|
660
|
+
*/
|
|
661
|
+
static isStructClass(item) {
|
|
662
|
+
if (item && item.schemaItemType === ECObjects_1.SchemaItemType.StructClass)
|
|
663
|
+
return true;
|
|
664
|
+
return false;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Type assertion to check if the SchemaItem is of type StructClass.
|
|
668
|
+
* @param item The SchemaItem to check.
|
|
669
|
+
* @returns The item cast to StructClass if it is a StructClass, undefined otherwise.
|
|
670
|
+
*/
|
|
671
|
+
static assertIsStructClass(item) {
|
|
672
|
+
if (!this.isStructClass(item))
|
|
673
|
+
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaItemType, `Expected '${ECObjects_1.SchemaItemType.StructClass}' (StructClass)`);
|
|
549
674
|
}
|
|
550
675
|
}
|
|
551
676
|
exports.StructClass = StructClass;
|