@itwin/ecschema-metadata 5.0.0-dev.99 → 5.1.0-dev.1

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.
Files changed (282) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Context.d.ts +3 -3
  3. package/lib/cjs/Context.d.ts.map +1 -1
  4. package/lib/cjs/Context.js +6 -6
  5. package/lib/cjs/Context.js.map +1 -1
  6. package/lib/cjs/DelayedPromise.d.ts +9 -8
  7. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  8. package/lib/cjs/DelayedPromise.js +2 -2
  9. package/lib/cjs/DelayedPromise.js.map +1 -1
  10. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  11. package/lib/cjs/Deserialization/Helper.js +27 -26
  12. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  13. package/lib/cjs/Deserialization/JsonParser.js +150 -150
  14. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  15. package/lib/cjs/Deserialization/JsonProps.d.ts +34 -34
  16. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  17. package/lib/cjs/Deserialization/JsonProps.js +3 -3
  18. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  19. package/lib/cjs/Deserialization/XmlParser.js +49 -49
  20. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  21. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +0 -5
  22. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  23. package/lib/cjs/Deserialization/XmlSerializationUtils.js +6 -11
  24. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  25. package/lib/cjs/ECName.d.ts +2 -2
  26. package/lib/cjs/ECName.js +4 -4
  27. package/lib/cjs/ECName.js.map +1 -1
  28. package/lib/cjs/ECObjects.d.ts +23 -11
  29. package/lib/cjs/ECObjects.d.ts.map +1 -1
  30. package/lib/cjs/ECObjects.js +47 -24
  31. package/lib/cjs/ECObjects.js.map +1 -1
  32. package/lib/cjs/Exception.d.ts +4 -4
  33. package/lib/cjs/Exception.d.ts.map +1 -1
  34. package/lib/cjs/Exception.js +60 -60
  35. package/lib/cjs/Exception.js.map +1 -1
  36. package/lib/cjs/Interfaces.d.ts +30 -34
  37. package/lib/cjs/Interfaces.d.ts.map +1 -1
  38. package/lib/cjs/Interfaces.js.map +1 -1
  39. package/lib/cjs/Metadata/Class.d.ts +107 -19
  40. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  41. package/lib/cjs/Metadata/Class.js +127 -47
  42. package/lib/cjs/Metadata/Class.js.map +1 -1
  43. package/lib/cjs/Metadata/Constant.d.ts +12 -9
  44. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  45. package/lib/cjs/Metadata/Constant.js +12 -9
  46. package/lib/cjs/Metadata/Constant.js.map +1 -1
  47. package/lib/cjs/Metadata/CustomAttribute.d.ts +2 -2
  48. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  49. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  50. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +5 -3
  51. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  52. package/lib/cjs/Metadata/CustomAttributeClass.js +7 -5
  53. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  54. package/lib/cjs/Metadata/EntityClass.d.ts +20 -3
  55. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  56. package/lib/cjs/Metadata/EntityClass.js +32 -14
  57. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  58. package/lib/cjs/Metadata/Enumeration.d.ts +16 -9
  59. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  60. package/lib/cjs/Metadata/Enumeration.js +20 -13
  61. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  62. package/lib/cjs/Metadata/Format.d.ts +32 -24
  63. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  64. package/lib/cjs/Metadata/Format.js +47 -27
  65. package/lib/cjs/Metadata/Format.js.map +1 -1
  66. package/lib/cjs/Metadata/InvertedUnit.d.ts +11 -7
  67. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  68. package/lib/cjs/Metadata/InvertedUnit.js +16 -10
  69. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  70. package/lib/cjs/Metadata/KindOfQuantity.d.ts +24 -15
  71. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  72. package/lib/cjs/Metadata/KindOfQuantity.js +54 -29
  73. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  74. package/lib/cjs/Metadata/Mixin.d.ts +16 -3
  75. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  76. package/lib/cjs/Metadata/Mixin.js +20 -7
  77. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  78. package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -12
  79. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  80. package/lib/cjs/Metadata/OverrideFormat.js +27 -19
  81. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  82. package/lib/cjs/Metadata/Phenomenon.d.ts +10 -2
  83. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  84. package/lib/cjs/Metadata/Phenomenon.js +11 -3
  85. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  86. package/lib/cjs/Metadata/Property.d.ts +46 -28
  87. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  88. package/lib/cjs/Metadata/Property.js +46 -22
  89. package/lib/cjs/Metadata/Property.js.map +1 -1
  90. package/lib/cjs/Metadata/PropertyCategory.d.ts +6 -3
  91. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  92. package/lib/cjs/Metadata/PropertyCategory.js +12 -5
  93. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  94. package/lib/cjs/Metadata/RelationshipClass.d.ts +48 -25
  95. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  96. package/lib/cjs/Metadata/RelationshipClass.js +54 -34
  97. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  98. package/lib/cjs/Metadata/Schema.d.ts +50 -28
  99. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  100. package/lib/cjs/Metadata/Schema.js +64 -42
  101. package/lib/cjs/Metadata/Schema.js.map +1 -1
  102. package/lib/cjs/Metadata/SchemaItem.d.ts +10 -19
  103. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  104. package/lib/cjs/Metadata/SchemaItem.js +12 -20
  105. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  106. package/lib/cjs/Metadata/Unit.d.ts +17 -21
  107. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  108. package/lib/cjs/Metadata/Unit.js +20 -22
  109. package/lib/cjs/Metadata/Unit.js.map +1 -1
  110. package/lib/cjs/Metadata/UnitSystem.d.ts +3 -1
  111. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  112. package/lib/cjs/Metadata/UnitSystem.js +4 -2
  113. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  114. package/lib/cjs/PropertyTypes.d.ts +11 -11
  115. package/lib/cjs/PropertyTypes.d.ts.map +1 -1
  116. package/lib/cjs/PropertyTypes.js +28 -20
  117. package/lib/cjs/PropertyTypes.js.map +1 -1
  118. package/lib/cjs/SchemaFormatsProvider.d.ts +39 -0
  119. package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -0
  120. package/lib/cjs/SchemaFormatsProvider.js +146 -0
  121. package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
  122. package/lib/cjs/SchemaJsonLocater.d.ts +5 -5
  123. package/lib/cjs/SchemaJsonLocater.js +4 -4
  124. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  125. package/lib/cjs/SchemaKey.d.ts +6 -6
  126. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  127. package/lib/cjs/SchemaKey.js +9 -9
  128. package/lib/cjs/SchemaKey.js.map +1 -1
  129. package/lib/cjs/SchemaLoader.d.ts +3 -3
  130. package/lib/cjs/SchemaLoader.js +4 -4
  131. package/lib/cjs/SchemaLoader.js.map +1 -1
  132. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
  133. package/lib/cjs/SchemaPartVisitorDelegate.js +1 -1
  134. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  135. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  136. package/lib/cjs/ecschema-metadata.d.ts +2 -1
  137. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  138. package/lib/cjs/ecschema-metadata.js +1 -0
  139. package/lib/cjs/ecschema-metadata.js.map +1 -1
  140. package/lib/cjs/utils/SchemaGraph.js +3 -3
  141. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  142. package/lib/esm/Context.d.ts +3 -3
  143. package/lib/esm/Context.d.ts.map +1 -1
  144. package/lib/esm/Context.js +7 -7
  145. package/lib/esm/Context.js.map +1 -1
  146. package/lib/esm/DelayedPromise.d.ts +9 -8
  147. package/lib/esm/DelayedPromise.d.ts.map +1 -1
  148. package/lib/esm/DelayedPromise.js +2 -2
  149. package/lib/esm/DelayedPromise.js.map +1 -1
  150. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  151. package/lib/esm/Deserialization/Helper.js +28 -27
  152. package/lib/esm/Deserialization/Helper.js.map +1 -1
  153. package/lib/esm/Deserialization/JsonParser.js +151 -151
  154. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  155. package/lib/esm/Deserialization/JsonProps.d.ts +34 -34
  156. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  157. package/lib/esm/Deserialization/JsonProps.js +3 -3
  158. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  159. package/lib/esm/Deserialization/XmlParser.js +50 -50
  160. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  161. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +0 -5
  162. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  163. package/lib/esm/Deserialization/XmlSerializationUtils.js +7 -12
  164. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  165. package/lib/esm/ECName.d.ts +2 -2
  166. package/lib/esm/ECName.js +5 -5
  167. package/lib/esm/ECName.js.map +1 -1
  168. package/lib/esm/ECObjects.d.ts +23 -11
  169. package/lib/esm/ECObjects.d.ts.map +1 -1
  170. package/lib/esm/ECObjects.js +48 -25
  171. package/lib/esm/ECObjects.js.map +1 -1
  172. package/lib/esm/Exception.d.ts +4 -4
  173. package/lib/esm/Exception.d.ts.map +1 -1
  174. package/lib/esm/Exception.js +58 -58
  175. package/lib/esm/Exception.js.map +1 -1
  176. package/lib/esm/Interfaces.d.ts +30 -34
  177. package/lib/esm/Interfaces.d.ts.map +1 -1
  178. package/lib/esm/Interfaces.js.map +1 -1
  179. package/lib/esm/Metadata/Class.d.ts +107 -19
  180. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  181. package/lib/esm/Metadata/Class.js +128 -48
  182. package/lib/esm/Metadata/Class.js.map +1 -1
  183. package/lib/esm/Metadata/Constant.d.ts +12 -9
  184. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  185. package/lib/esm/Metadata/Constant.js +13 -10
  186. package/lib/esm/Metadata/Constant.js.map +1 -1
  187. package/lib/esm/Metadata/CustomAttribute.d.ts +2 -2
  188. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
  189. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  190. package/lib/esm/Metadata/CustomAttributeClass.d.ts +5 -3
  191. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  192. package/lib/esm/Metadata/CustomAttributeClass.js +8 -6
  193. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  194. package/lib/esm/Metadata/EntityClass.d.ts +20 -3
  195. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  196. package/lib/esm/Metadata/EntityClass.js +33 -15
  197. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  198. package/lib/esm/Metadata/Enumeration.d.ts +16 -9
  199. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  200. package/lib/esm/Metadata/Enumeration.js +21 -14
  201. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  202. package/lib/esm/Metadata/Format.d.ts +32 -24
  203. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  204. package/lib/esm/Metadata/Format.js +48 -28
  205. package/lib/esm/Metadata/Format.js.map +1 -1
  206. package/lib/esm/Metadata/InvertedUnit.d.ts +11 -7
  207. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  208. package/lib/esm/Metadata/InvertedUnit.js +17 -11
  209. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  210. package/lib/esm/Metadata/KindOfQuantity.d.ts +24 -15
  211. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  212. package/lib/esm/Metadata/KindOfQuantity.js +55 -30
  213. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  214. package/lib/esm/Metadata/Mixin.d.ts +16 -3
  215. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  216. package/lib/esm/Metadata/Mixin.js +21 -8
  217. package/lib/esm/Metadata/Mixin.js.map +1 -1
  218. package/lib/esm/Metadata/OverrideFormat.d.ts +12 -12
  219. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  220. package/lib/esm/Metadata/OverrideFormat.js +28 -20
  221. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  222. package/lib/esm/Metadata/Phenomenon.d.ts +10 -2
  223. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  224. package/lib/esm/Metadata/Phenomenon.js +12 -4
  225. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  226. package/lib/esm/Metadata/Property.d.ts +46 -28
  227. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  228. package/lib/esm/Metadata/Property.js +47 -23
  229. package/lib/esm/Metadata/Property.js.map +1 -1
  230. package/lib/esm/Metadata/PropertyCategory.d.ts +6 -3
  231. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  232. package/lib/esm/Metadata/PropertyCategory.js +13 -6
  233. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  234. package/lib/esm/Metadata/RelationshipClass.d.ts +48 -25
  235. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  236. package/lib/esm/Metadata/RelationshipClass.js +55 -35
  237. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  238. package/lib/esm/Metadata/Schema.d.ts +50 -28
  239. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  240. package/lib/esm/Metadata/Schema.js +65 -43
  241. package/lib/esm/Metadata/Schema.js.map +1 -1
  242. package/lib/esm/Metadata/SchemaItem.d.ts +10 -19
  243. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  244. package/lib/esm/Metadata/SchemaItem.js +13 -21
  245. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  246. package/lib/esm/Metadata/Unit.d.ts +17 -21
  247. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  248. package/lib/esm/Metadata/Unit.js +21 -23
  249. package/lib/esm/Metadata/Unit.js.map +1 -1
  250. package/lib/esm/Metadata/UnitSystem.d.ts +3 -1
  251. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  252. package/lib/esm/Metadata/UnitSystem.js +5 -3
  253. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  254. package/lib/esm/PropertyTypes.d.ts +11 -11
  255. package/lib/esm/PropertyTypes.d.ts.map +1 -1
  256. package/lib/esm/PropertyTypes.js +29 -21
  257. package/lib/esm/PropertyTypes.js.map +1 -1
  258. package/lib/esm/SchemaFormatsProvider.d.ts +39 -0
  259. package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -0
  260. package/lib/esm/SchemaFormatsProvider.js +142 -0
  261. package/lib/esm/SchemaFormatsProvider.js.map +1 -0
  262. package/lib/esm/SchemaJsonLocater.d.ts +5 -5
  263. package/lib/esm/SchemaJsonLocater.js +4 -4
  264. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  265. package/lib/esm/SchemaKey.d.ts +6 -6
  266. package/lib/esm/SchemaKey.d.ts.map +1 -1
  267. package/lib/esm/SchemaKey.js +10 -10
  268. package/lib/esm/SchemaKey.js.map +1 -1
  269. package/lib/esm/SchemaLoader.d.ts +3 -3
  270. package/lib/esm/SchemaLoader.js +5 -5
  271. package/lib/esm/SchemaLoader.js.map +1 -1
  272. package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
  273. package/lib/esm/SchemaPartVisitorDelegate.js +1 -1
  274. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  275. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  276. package/lib/esm/ecschema-metadata.d.ts +2 -1
  277. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  278. package/lib/esm/ecschema-metadata.js +1 -0
  279. package/lib/esm/ecschema-metadata.js.map +1 -1
  280. package/lib/esm/utils/SchemaGraph.js +4 -4
  281. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  282. package/package.json +8 -6
@@ -52,18 +52,18 @@ class XmlParser extends AbstractParser_1.AbstractParser {
52
52
  parseSchema() {
53
53
  const schemaMetadata = this._rawSchema.documentElement;
54
54
  if ("ECSchema" !== schemaMetadata.nodeName)
55
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
55
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
56
56
  const schemaDefDuplicates = this.getElementChildrenByTagName(schemaMetadata, "ECSchema");
57
57
  if (schemaDefDuplicates.length > 1)
58
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
58
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
59
59
  if (this._schemaName === undefined)
60
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
60
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
61
61
  if (this._schemaVersion === undefined)
62
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
62
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
63
63
  if (this._xmlNamespace === undefined)
64
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
64
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
65
65
  if (this._ecSpecVersion === undefined)
66
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
66
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
67
67
  const alias = this.getRequiredAttribute(schemaMetadata, "alias", `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);
68
68
  const description = this.getOptionalAttribute(schemaMetadata, "description");
69
69
  const displayLabel = this.getOptionalAttribute(schemaMetadata, "displayLabel");
@@ -104,11 +104,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
104
104
  if (itemType === undefined) {
105
105
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
106
106
  continue;
107
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
107
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
108
108
  }
109
109
  const itemName = this.getRequiredAttribute(item, "typeName", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);
110
110
  if (!ECName_1.ECName.validate(itemName))
111
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
111
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
112
112
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
113
113
  this._schemaItems.set(itemName, [itemType, item]);
114
114
  yield [itemName, itemType, item];
@@ -167,22 +167,22 @@ class XmlParser extends AbstractParser_1.AbstractParser {
167
167
  const baseClasses = this.getElementChildrenByTagName(xmlElement, "BaseClass");
168
168
  // Mixins can only have one base class
169
169
  if (baseClasses.length > 1)
170
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
170
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
171
171
  const customAttributesResult = this.getElementChildrenByTagName(xmlElement, "ECCustomAttributes");
172
172
  if (customAttributesResult.length < 1)
173
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
173
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
174
174
  const customAttributes = customAttributesResult[0];
175
175
  const isMixinResult = this.getElementChildrenByTagName(customAttributes, "IsMixin");
176
176
  if (isMixinResult.length < 1)
177
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
177
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
178
178
  const mixinAttributes = isMixinResult[0];
179
179
  const appliesToResult = this.getElementChildrenByTagName(mixinAttributes, "AppliesToEntityClass");
180
180
  if (appliesToResult.length < 1)
181
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
181
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
182
182
  const appliesToElement = appliesToResult[0];
183
183
  let appliesTo = appliesToElement.textContent;
184
184
  if (appliesTo === null || appliesTo.length === 0)
185
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
185
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
186
186
  appliesTo = this.getQualifiedTypeName(appliesTo);
187
187
  const mixinProps = {
188
188
  ...classProps,
@@ -211,17 +211,17 @@ class XmlParser extends AbstractParser_1.AbstractParser {
211
211
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
212
212
  if (sourceResult.length !== 1) {
213
213
  if (sourceResult.length === 0)
214
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
214
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
215
215
  else
216
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
216
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
217
217
  }
218
218
  const source = this.getRelationshipConstraintProps(sourceResult[0], true);
219
219
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
220
220
  if (targetResult.length !== 1) {
221
221
  if (targetResult.length === 0)
222
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
222
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
223
223
  else
224
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
224
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
225
225
  }
226
226
  const target = this.getRelationshipConstraintProps(targetResult[0], false);
227
227
  return {
@@ -248,7 +248,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
248
248
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
249
249
  tempBackingType = ECObjects_1.PrimitiveType.String;
250
250
  else
251
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
251
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
252
252
  }
253
253
  let isStrictString = this.getOptionalAttribute(xmlElement, "isStrict");
254
254
  if (isStrictString === undefined)
@@ -263,7 +263,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
263
263
  if (ECObjects_1.PrimitiveType.Integer === tempBackingType) {
264
264
  const numericValue = parseInt(valueString, 10);
265
265
  if (isNaN(numericValue))
266
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
266
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
267
267
  value = numericValue;
268
268
  }
269
269
  const label = this.getOptionalAttribute(element, "displayLabel");
@@ -289,7 +289,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
289
289
  const relativeErrorString = this.getRequiredAttribute(xmlElement, "relativeError", `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
290
290
  const relativeError = parseFloat(relativeErrorString);
291
291
  if (isNaN(relativeError))
292
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
292
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
293
293
  const presentationUnitsString = this.getOptionalAttribute(xmlElement, "presentationUnits");
294
294
  let presentationUnits;
295
295
  if (presentationUnitsString)
@@ -308,7 +308,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
308
308
  const priorityString = this.getRequiredAttribute(xmlElement, "priority", `The PropertyCategory ${this._currentItemFullName} is missing the required 'priority' attribute.`);
309
309
  const priority = parseInt(priorityString, 10);
310
310
  if (isNaN(priority))
311
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
311
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
312
312
  return {
313
313
  ...itemProps,
314
314
  priority,
@@ -397,11 +397,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
397
397
  const units = new Array();
398
398
  const unitsResult = this.getElementChildrenByTagName(compositeElement, "Unit");
399
399
  if (unitsResult.length < 1)
400
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
400
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
401
401
  for (const unit of unitsResult) {
402
402
  let name = unit.textContent;
403
403
  if (null === name || 0 === name.length)
404
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
404
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
405
405
  const label = this.getOptionalAttribute(unit, "label");
406
406
  name = this.getQualifiedTypeName(name);
407
407
  units.push({ name, label });
@@ -441,7 +441,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
441
441
  const propertyType = this.getPropertyType(childType);
442
442
  // This may not be needed, just a failsafe if the regex is faulty
443
443
  if (propertyType === undefined)
444
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
444
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
445
445
  yield [propertyName, propertyType, child];
446
446
  }
447
447
  }
@@ -502,12 +502,12 @@ class XmlParser extends AbstractParser_1.AbstractParser {
502
502
  getRelationshipConstraintCustomAttributeProviders(xmlElement) {
503
503
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
504
504
  if (sourceResult.length < 1)
505
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
505
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
506
506
  const sourceElement = sourceResult[0];
507
507
  const sourceCustomAttributes = this.getCustomAttributeProviders(sourceElement, "Source Constraint of", this._currentItemFullName);
508
508
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
509
509
  if (targetResult.length < 1)
510
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
510
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
511
511
  const targetElement = targetResult[0];
512
512
  const targetCustomAttributes = this.getCustomAttributeProviders(targetElement, "Source Constraint of", this._currentItemFullName);
513
513
  return [sourceCustomAttributes, targetCustomAttributes];
@@ -556,7 +556,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
556
556
  if (resultString) {
557
557
  result = parseFloat(resultString);
558
558
  if (isNaN(result))
559
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
559
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
560
560
  }
561
561
  return result;
562
562
  }
@@ -566,7 +566,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
566
566
  if (resultString) {
567
567
  result = parseInt(resultString, 10);
568
568
  if (isNaN(result))
569
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
569
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
570
570
  }
571
571
  return result;
572
572
  }
@@ -577,14 +577,14 @@ class XmlParser extends AbstractParser_1.AbstractParser {
577
577
  else if ("false" === textString)
578
578
  return false;
579
579
  else
580
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
580
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
581
581
  }
582
582
  getRequiredAttribute(xmlElement, attributeName, errorMsg) {
583
583
  if (!xmlElement.hasAttribute(attributeName))
584
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, errorMsg);
584
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, errorMsg);
585
585
  const result = xmlElement.getAttribute(attributeName);
586
586
  if (result === null)
587
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, errorMsg);
587
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, errorMsg);
588
588
  return result;
589
589
  }
590
590
  getSchemaReference(xmlElement) {
@@ -660,11 +660,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
660
660
  const constraintClasses = new Array();
661
661
  const constraintClassesResult = this.getElementChildrenByTagName(xmlElement, "Class");
662
662
  if (constraintClassesResult.length < 1)
663
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
663
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
664
664
  for (const constraintClass of constraintClassesResult) {
665
665
  let constraintClassId = constraintClass.getAttribute("class");
666
666
  if (null === constraintClassId || 0 === constraintClassId.length)
667
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
667
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
668
668
  constraintClassId = this.getQualifiedTypeName(constraintClassId);
669
669
  constraintClasses.push(constraintClassId);
670
670
  }
@@ -693,7 +693,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
693
693
  const propName = this.getPropertyName(xmlElement);
694
694
  const propType = this.getPropertyType(xmlElement.nodeName);
695
695
  if (propType === undefined)
696
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
696
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
697
697
  const label = this.getOptionalAttribute(xmlElement, "displayLabel");
698
698
  const description = this.getOptionalAttribute(xmlElement, "description");
699
699
  const readOnlyString = this.getOptionalAttribute(xmlElement, "readOnly");
@@ -761,7 +761,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
761
761
  else if (undefined !== maxOccursStr) {
762
762
  maxOccurs = parseInt(maxOccursStr, 10);
763
763
  if (isNaN(maxOccurs))
764
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
764
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
765
765
  }
766
766
  return { minOccurs, maxOccurs };
767
767
  }
@@ -785,7 +785,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
785
785
  ns = `${this._schemaName}.${this._schemaVersion}`;
786
786
  }
787
787
  if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))
788
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
788
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
789
789
  const schemaNameParts = ns.split(".");
790
790
  const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;
791
791
  const properties = this.getElementChildren(xmlCustomAttribute);
@@ -814,7 +814,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
814
814
  if (propertyClass.isEnumeration() && propertyClass.enumeration) {
815
815
  enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName, Enumeration_1.Enumeration);
816
816
  if (!enumeration)
817
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
817
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
818
818
  }
819
819
  const primitiveType = enumeration && enumeration.type ? enumeration.type : (propertyClass).primitiveType;
820
820
  return this.readPrimitivePropertyValue(propElement, primitiveType);
@@ -861,9 +861,9 @@ class XmlParser extends AbstractParser_1.AbstractParser {
861
861
  }
862
862
  readPrimitivePropertyValue(propElement, primitiveType) {
863
863
  if (undefined === propElement.textContent || null === propElement.textContent)
864
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
864
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
865
865
  if (propElement.textContent === "" && primitiveType !== ECObjects_1.PrimitiveType.String)
866
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
866
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
867
867
  // TODO: Mapping all primitive types to string, number and boolean
868
868
  // for now. Need to review with IModelJs.
869
869
  switch (primitiveType) {
@@ -885,7 +885,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
885
885
  case ECObjects_1.PrimitiveType.Double:
886
886
  return this.getDoublePropertyValue(propElement.textContent, propElement.tagName);
887
887
  default:
888
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
888
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
889
889
  }
890
890
  }
891
891
  getBooleanPropertyValue(propValue, propName) {
@@ -897,47 +897,47 @@ class XmlParser extends AbstractParser_1.AbstractParser {
897
897
  Number.parseInt(propValue, 10) === 0) {
898
898
  return false;
899
899
  }
900
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
900
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
901
901
  }
902
902
  getIntegerPropertyValue(propValue, propName) {
903
903
  const result = Number.parseFloat(propValue);
904
904
  if (isNaN(result) || result % 1 !== 0)
905
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
905
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
906
906
  return result;
907
907
  }
908
908
  getDatePropertyValue(propValue, propName) {
909
909
  const result = Number.parseInt(propValue, 10);
910
910
  if (isNaN(result))
911
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
911
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
912
912
  return new Date(result);
913
913
  }
914
914
  getDoublePropertyValue(propValue, propName) {
915
915
  const result = Number.parseFloat(propValue);
916
916
  if (isNaN(result))
917
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
917
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
918
918
  return result;
919
919
  }
920
920
  getPoint2DPropertyValue(propValue, propName) {
921
921
  const result = propValue.split(",");
922
922
  if (result.length !== 2) {
923
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
923
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
924
924
  }
925
925
  const x = Number.parseFloat(result[0]);
926
926
  const y = Number.parseFloat(result[1]);
927
927
  if (isNaN(x) || isNaN(y))
928
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
928
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
929
929
  return { x, y };
930
930
  }
931
931
  getPoint3DPropertyValue(propValue, propName) {
932
932
  const result = propValue.split(",");
933
933
  if (result.length !== 3) {
934
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
934
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
935
935
  }
936
936
  const x = Number.parseFloat(result[0]);
937
937
  const y = Number.parseFloat(result[1]);
938
938
  const z = Number.parseFloat(result[2]);
939
939
  if (isNaN(x) || isNaN(y) || isNaN(z))
940
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
940
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
941
941
  return { x, y, z };
942
942
  }
943
943
  isSchemaFullNameValidForVersion(schemaFullName, ecSpecVersion) {
@@ -969,7 +969,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
969
969
  return `${this._schemaName}.${nameParts[1]}`;
970
970
  if (this._schemaReferenceNames.has(nameParts[0].toLowerCase()))
971
971
  return `${this._schemaReferenceNames.get(nameParts[0].toLowerCase())}.${nameParts[1]}`;
972
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
972
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
973
973
  }
974
974
  /** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,
975
975
  * meaning all of the references in the format string need to be changed.