@itwin/ecschema-metadata 5.0.0-dev.98 → 5.0.0

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 +61 -1
  2. package/lib/cjs/Context.d.ts +4 -4
  3. package/lib/cjs/Context.d.ts.map +1 -1
  4. package/lib/cjs/Context.js +7 -7
  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 +24 -12
  29. package/lib/cjs/ECObjects.d.ts.map +1 -1
  30. package/lib/cjs/ECObjects.js +48 -25
  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 +6 -4
  51. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  52. package/lib/cjs/Metadata/CustomAttributeClass.js +8 -6
  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 +172 -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 +4 -4
  143. package/lib/esm/Context.d.ts.map +1 -1
  144. package/lib/esm/Context.js +8 -8
  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 +24 -12
  169. package/lib/esm/ECObjects.d.ts.map +1 -1
  170. package/lib/esm/ECObjects.js +49 -26
  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 +6 -4
  191. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  192. package/lib/esm/Metadata/CustomAttributeClass.js +9 -7
  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 +168 -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 +12 -6
@@ -4,7 +4,7 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { assert } from "@itwin/core-bentley";
6
6
  import { parsePrimitiveType, PrimitiveType, primitiveTypeToString, StrengthDirection, strengthDirectionToString } from "../ECObjects";
7
- import { ECObjectsError, ECObjectsStatus } from "../Exception";
7
+ import { ECSchemaError, ECSchemaStatus } from "../Exception";
8
8
  import { Enumeration } from "../Metadata/Enumeration";
9
9
  import { ECName } from "../ECName";
10
10
  import { AbstractParser } from "./AbstractParser";
@@ -49,18 +49,18 @@ export class XmlParser extends AbstractParser {
49
49
  parseSchema() {
50
50
  const schemaMetadata = this._rawSchema.documentElement;
51
51
  if ("ECSchema" !== schemaMetadata.nodeName)
52
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
52
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
53
53
  const schemaDefDuplicates = this.getElementChildrenByTagName(schemaMetadata, "ECSchema");
54
54
  if (schemaDefDuplicates.length > 1)
55
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
55
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
56
56
  if (this._schemaName === undefined)
57
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
57
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
58
58
  if (this._schemaVersion === undefined)
59
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
59
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
60
60
  if (this._xmlNamespace === undefined)
61
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
61
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
62
62
  if (this._ecSpecVersion === undefined)
63
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
63
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
64
64
  const alias = this.getRequiredAttribute(schemaMetadata, "alias", `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);
65
65
  const description = this.getOptionalAttribute(schemaMetadata, "description");
66
66
  const displayLabel = this.getOptionalAttribute(schemaMetadata, "displayLabel");
@@ -101,11 +101,11 @@ export class XmlParser extends AbstractParser {
101
101
  if (itemType === undefined) {
102
102
  if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
103
103
  continue;
104
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
104
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
105
105
  }
106
106
  const itemName = this.getRequiredAttribute(item, "typeName", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);
107
107
  if (!ECName.validate(itemName))
108
- throw new ECObjectsError(ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
108
+ throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
109
109
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
110
110
  this._schemaItems.set(itemName, [itemType, item]);
111
111
  yield [itemName, itemType, item];
@@ -164,22 +164,22 @@ export class XmlParser extends AbstractParser {
164
164
  const baseClasses = this.getElementChildrenByTagName(xmlElement, "BaseClass");
165
165
  // Mixins can only have one base class
166
166
  if (baseClasses.length > 1)
167
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
167
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
168
168
  const customAttributesResult = this.getElementChildrenByTagName(xmlElement, "ECCustomAttributes");
169
169
  if (customAttributesResult.length < 1)
170
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
170
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
171
171
  const customAttributes = customAttributesResult[0];
172
172
  const isMixinResult = this.getElementChildrenByTagName(customAttributes, "IsMixin");
173
173
  if (isMixinResult.length < 1)
174
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
174
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
175
175
  const mixinAttributes = isMixinResult[0];
176
176
  const appliesToResult = this.getElementChildrenByTagName(mixinAttributes, "AppliesToEntityClass");
177
177
  if (appliesToResult.length < 1)
178
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
178
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
179
179
  const appliesToElement = appliesToResult[0];
180
180
  let appliesTo = appliesToElement.textContent;
181
181
  if (appliesTo === null || appliesTo.length === 0)
182
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
182
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
183
183
  appliesTo = this.getQualifiedTypeName(appliesTo);
184
184
  const mixinProps = {
185
185
  ...classProps,
@@ -208,17 +208,17 @@ export class XmlParser extends AbstractParser {
208
208
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
209
209
  if (sourceResult.length !== 1) {
210
210
  if (sourceResult.length === 0)
211
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
211
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
212
212
  else
213
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
213
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
214
214
  }
215
215
  const source = this.getRelationshipConstraintProps(sourceResult[0], true);
216
216
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
217
217
  if (targetResult.length !== 1) {
218
218
  if (targetResult.length === 0)
219
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
219
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
220
220
  else
221
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
221
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
222
222
  }
223
223
  const target = this.getRelationshipConstraintProps(targetResult[0], false);
224
224
  return {
@@ -245,7 +245,7 @@ export class XmlParser extends AbstractParser {
245
245
  if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
246
246
  tempBackingType = PrimitiveType.String;
247
247
  else
248
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
248
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
249
249
  }
250
250
  let isStrictString = this.getOptionalAttribute(xmlElement, "isStrict");
251
251
  if (isStrictString === undefined)
@@ -260,7 +260,7 @@ export class XmlParser extends AbstractParser {
260
260
  if (PrimitiveType.Integer === tempBackingType) {
261
261
  const numericValue = parseInt(valueString, 10);
262
262
  if (isNaN(numericValue))
263
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
263
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
264
264
  value = numericValue;
265
265
  }
266
266
  const label = this.getOptionalAttribute(element, "displayLabel");
@@ -286,7 +286,7 @@ export class XmlParser extends AbstractParser {
286
286
  const relativeErrorString = this.getRequiredAttribute(xmlElement, "relativeError", `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
287
287
  const relativeError = parseFloat(relativeErrorString);
288
288
  if (isNaN(relativeError))
289
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
289
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
290
290
  const presentationUnitsString = this.getOptionalAttribute(xmlElement, "presentationUnits");
291
291
  let presentationUnits;
292
292
  if (presentationUnitsString)
@@ -305,7 +305,7 @@ export class XmlParser extends AbstractParser {
305
305
  const priorityString = this.getRequiredAttribute(xmlElement, "priority", `The PropertyCategory ${this._currentItemFullName} is missing the required 'priority' attribute.`);
306
306
  const priority = parseInt(priorityString, 10);
307
307
  if (isNaN(priority))
308
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
308
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
309
309
  return {
310
310
  ...itemProps,
311
311
  priority,
@@ -394,11 +394,11 @@ export class XmlParser extends AbstractParser {
394
394
  const units = new Array();
395
395
  const unitsResult = this.getElementChildrenByTagName(compositeElement, "Unit");
396
396
  if (unitsResult.length < 1)
397
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
397
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
398
398
  for (const unit of unitsResult) {
399
399
  let name = unit.textContent;
400
400
  if (null === name || 0 === name.length)
401
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
401
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
402
402
  const label = this.getOptionalAttribute(unit, "label");
403
403
  name = this.getQualifiedTypeName(name);
404
404
  units.push({ name, label });
@@ -438,7 +438,7 @@ export class XmlParser extends AbstractParser {
438
438
  const propertyType = this.getPropertyType(childType);
439
439
  // This may not be needed, just a failsafe if the regex is faulty
440
440
  if (propertyType === undefined)
441
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
441
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
442
442
  yield [propertyName, propertyType, child];
443
443
  }
444
444
  }
@@ -499,12 +499,12 @@ export class XmlParser extends AbstractParser {
499
499
  getRelationshipConstraintCustomAttributeProviders(xmlElement) {
500
500
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
501
501
  if (sourceResult.length < 1)
502
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
502
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
503
503
  const sourceElement = sourceResult[0];
504
504
  const sourceCustomAttributes = this.getCustomAttributeProviders(sourceElement, "Source Constraint of", this._currentItemFullName);
505
505
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
506
506
  if (targetResult.length < 1)
507
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
507
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
508
508
  const targetElement = targetResult[0];
509
509
  const targetCustomAttributes = this.getCustomAttributeProviders(targetElement, "Source Constraint of", this._currentItemFullName);
510
510
  return [sourceCustomAttributes, targetCustomAttributes];
@@ -553,7 +553,7 @@ export class XmlParser extends AbstractParser {
553
553
  if (resultString) {
554
554
  result = parseFloat(resultString);
555
555
  if (isNaN(result))
556
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
556
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
557
557
  }
558
558
  return result;
559
559
  }
@@ -563,7 +563,7 @@ export class XmlParser extends AbstractParser {
563
563
  if (resultString) {
564
564
  result = parseInt(resultString, 10);
565
565
  if (isNaN(result))
566
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
566
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
567
567
  }
568
568
  return result;
569
569
  }
@@ -574,14 +574,14 @@ export class XmlParser extends AbstractParser {
574
574
  else if ("false" === textString)
575
575
  return false;
576
576
  else
577
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
577
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
578
578
  }
579
579
  getRequiredAttribute(xmlElement, attributeName, errorMsg) {
580
580
  if (!xmlElement.hasAttribute(attributeName))
581
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, errorMsg);
581
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);
582
582
  const result = xmlElement.getAttribute(attributeName);
583
583
  if (result === null)
584
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, errorMsg);
584
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);
585
585
  return result;
586
586
  }
587
587
  getSchemaReference(xmlElement) {
@@ -657,11 +657,11 @@ export class XmlParser extends AbstractParser {
657
657
  const constraintClasses = new Array();
658
658
  const constraintClassesResult = this.getElementChildrenByTagName(xmlElement, "Class");
659
659
  if (constraintClassesResult.length < 1)
660
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
660
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
661
661
  for (const constraintClass of constraintClassesResult) {
662
662
  let constraintClassId = constraintClass.getAttribute("class");
663
663
  if (null === constraintClassId || 0 === constraintClassId.length)
664
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
664
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
665
665
  constraintClassId = this.getQualifiedTypeName(constraintClassId);
666
666
  constraintClasses.push(constraintClassId);
667
667
  }
@@ -690,7 +690,7 @@ export class XmlParser extends AbstractParser {
690
690
  const propName = this.getPropertyName(xmlElement);
691
691
  const propType = this.getPropertyType(xmlElement.nodeName);
692
692
  if (propType === undefined)
693
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
693
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
694
694
  const label = this.getOptionalAttribute(xmlElement, "displayLabel");
695
695
  const description = this.getOptionalAttribute(xmlElement, "description");
696
696
  const readOnlyString = this.getOptionalAttribute(xmlElement, "readOnly");
@@ -758,7 +758,7 @@ export class XmlParser extends AbstractParser {
758
758
  else if (undefined !== maxOccursStr) {
759
759
  maxOccurs = parseInt(maxOccursStr, 10);
760
760
  if (isNaN(maxOccurs))
761
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
761
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
762
762
  }
763
763
  return { minOccurs, maxOccurs };
764
764
  }
@@ -782,7 +782,7 @@ export class XmlParser extends AbstractParser {
782
782
  ns = `${this._schemaName}.${this._schemaVersion}`;
783
783
  }
784
784
  if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))
785
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
785
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
786
786
  const schemaNameParts = ns.split(".");
787
787
  const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;
788
788
  const properties = this.getElementChildren(xmlCustomAttribute);
@@ -811,7 +811,7 @@ export class XmlParser extends AbstractParser {
811
811
  if (propertyClass.isEnumeration() && propertyClass.enumeration) {
812
812
  enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName, Enumeration);
813
813
  if (!enumeration)
814
- throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
814
+ throw new ECSchemaError(ECSchemaStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
815
815
  }
816
816
  const primitiveType = enumeration && enumeration.type ? enumeration.type : (propertyClass).primitiveType;
817
817
  return this.readPrimitivePropertyValue(propElement, primitiveType);
@@ -858,9 +858,9 @@ export class XmlParser extends AbstractParser {
858
858
  }
859
859
  readPrimitivePropertyValue(propElement, primitiveType) {
860
860
  if (undefined === propElement.textContent || null === propElement.textContent)
861
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
861
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
862
862
  if (propElement.textContent === "" && primitiveType !== PrimitiveType.String)
863
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
863
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
864
864
  // TODO: Mapping all primitive types to string, number and boolean
865
865
  // for now. Need to review with IModelJs.
866
866
  switch (primitiveType) {
@@ -882,7 +882,7 @@ export class XmlParser extends AbstractParser {
882
882
  case PrimitiveType.Double:
883
883
  return this.getDoublePropertyValue(propElement.textContent, propElement.tagName);
884
884
  default:
885
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
885
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
886
886
  }
887
887
  }
888
888
  getBooleanPropertyValue(propValue, propName) {
@@ -894,47 +894,47 @@ export class XmlParser extends AbstractParser {
894
894
  Number.parseInt(propValue, 10) === 0) {
895
895
  return false;
896
896
  }
897
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
897
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
898
898
  }
899
899
  getIntegerPropertyValue(propValue, propName) {
900
900
  const result = Number.parseFloat(propValue);
901
901
  if (isNaN(result) || result % 1 !== 0)
902
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
902
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
903
903
  return result;
904
904
  }
905
905
  getDatePropertyValue(propValue, propName) {
906
906
  const result = Number.parseInt(propValue, 10);
907
907
  if (isNaN(result))
908
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
908
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
909
909
  return new Date(result);
910
910
  }
911
911
  getDoublePropertyValue(propValue, propName) {
912
912
  const result = Number.parseFloat(propValue);
913
913
  if (isNaN(result))
914
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
914
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
915
915
  return result;
916
916
  }
917
917
  getPoint2DPropertyValue(propValue, propName) {
918
918
  const result = propValue.split(",");
919
919
  if (result.length !== 2) {
920
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
920
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
921
921
  }
922
922
  const x = Number.parseFloat(result[0]);
923
923
  const y = Number.parseFloat(result[1]);
924
924
  if (isNaN(x) || isNaN(y))
925
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
925
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
926
926
  return { x, y };
927
927
  }
928
928
  getPoint3DPropertyValue(propValue, propName) {
929
929
  const result = propValue.split(",");
930
930
  if (result.length !== 3) {
931
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
931
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
932
932
  }
933
933
  const x = Number.parseFloat(result[0]);
934
934
  const y = Number.parseFloat(result[1]);
935
935
  const z = Number.parseFloat(result[2]);
936
936
  if (isNaN(x) || isNaN(y) || isNaN(z))
937
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
937
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
938
938
  return { x, y, z };
939
939
  }
940
940
  isSchemaFullNameValidForVersion(schemaFullName, ecSpecVersion) {
@@ -966,7 +966,7 @@ export class XmlParser extends AbstractParser {
966
966
  return `${this._schemaName}.${nameParts[1]}`;
967
967
  if (this._schemaReferenceNames.has(nameParts[0].toLowerCase()))
968
968
  return `${this._schemaReferenceNames.get(nameParts[0].toLowerCase())}.${nameParts[1]}`;
969
- throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
969
+ throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
970
970
  }
971
971
  /** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,
972
972
  * meaning all of the references in the format string need to be changed.