@itwin/ecschema-metadata 5.7.0-dev.3 → 5.7.0-dev.5
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/lib/cjs/Metadata/Class.d.ts +5 -0
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +5 -0
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +5 -0
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +5 -0
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/package.json +6 -6
|
@@ -38,6 +38,11 @@ export declare abstract class ECClass extends SchemaItem implements CustomAttrib
|
|
|
38
38
|
protected setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;
|
|
39
39
|
/**
|
|
40
40
|
* Gets the derived classes belonging to this class.
|
|
41
|
+
* @note This method relies on the `SchemaContext` to find derived classes.
|
|
42
|
+
* It will **only** return derived classes from schemas that have already been loaded into the context.
|
|
43
|
+
* If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.
|
|
44
|
+
* To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`
|
|
45
|
+
* before calling this method.
|
|
41
46
|
* @returns An array of ECClasses or undefined if no derived classes exist.
|
|
42
47
|
*/
|
|
43
48
|
getDerivedClasses(): Promise<ECClass[] | undefined>;
|
|
@@ -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,EAAiD,eAAe,EAA0C,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE9L,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,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AAE,MAAM,EAAE,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"}
|
|
@@ -69,6 +69,11 @@ class ECClass extends SchemaItem_1.SchemaItem {
|
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Gets the derived classes belonging to this class.
|
|
72
|
+
* @note This method relies on the `SchemaContext` to find derived classes.
|
|
73
|
+
* It will **only** return derived classes from schemas that have already been loaded into the context.
|
|
74
|
+
* If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.
|
|
75
|
+
* To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`
|
|
76
|
+
* before calling this method.
|
|
72
77
|
* @returns An array of ECClasses or undefined if no derived classes exist.
|
|
73
78
|
*/
|
|
74
79
|
async getDerivedClasses() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqD;AACrD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8L;AAC9L,4CAA6D;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ACtC;;OAEG;IACsB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAErE;;;OAGG;IACI,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,WAAW;YAC5D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AAjCD,kCAiCC;AAED;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,OAAO;CA6BjD;AA7BD,oCA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { assert, Logger } from \"@itwin/core-bentley\";\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ClassProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport {\r\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\r\n} from \"./Property\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\n\r\nconst loggingCategory = \"ECClass\";\r\n\r\n/**\r\n * A common abstract class for all of the ECClass types.\r\n * @public @preview\r\n */\r\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\r\n /** @internal */\r\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\r\n private _modifier: ECClassModifier;\r\n private _baseClass?: LazyLoadedECClass;\r\n private _properties?: Map<string, Property>;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n private _mergedPropertyCache?: Map<string, Property>;\r\n\r\n public get modifier() { return this._modifier; }\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name);\r\n\r\n if (modifier)\r\n this._modifier = modifier;\r\n else\r\n this._modifier = ECClassModifier.None;\r\n }\r\n\r\n /**\r\n * Gets the base class if it exists, otherwise returns undefined.\r\n */\r\n public get baseClass(): LazyLoadedECClass | undefined {\r\n return this._baseClass;\r\n }\r\n\r\n public getBaseClassSync(): ECClass | undefined {\r\n if (!this.baseClass) {\r\n return undefined;\r\n }\r\n\r\n return this.schema.lookupItemSync(this.baseClass, ECClass);\r\n }\r\n\r\n /**\r\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\r\n *\r\n * @internal\r\n */\r\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\r\n const oldBaseClass = this._baseClass;\r\n this._baseClass = baseClass;\r\n\r\n if (baseClass)\r\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\r\n else if (oldBaseClass)\r\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\r\n }\r\n\r\n /**\r\n * Gets the derived classes belonging to this class.\r\n * @returns An array of ECClasses or undefined if no derived classes exist.\r\n */\r\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\r\n const derivedClasses: ECClass[] = [];\r\n for(const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\r\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\r\n if (derivedClass) {\r\n derivedClasses.push(derivedClass);\r\n continue;\r\n }\r\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\r\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\r\n if (derivedClass)\r\n derivedClasses.push(derivedClass);\r\n }\r\n\r\n if (derivedClasses.length === 0)\r\n return undefined;\r\n\r\n return derivedClasses;\r\n }\r\n\r\n /**\r\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\r\n * @param prop The property to add.\r\n * @return The property that was added.\r\n *\r\n * @internal\r\n */\r\n protected addProperty<T extends Property>(prop: T): T {\r\n if (!this._properties)\r\n this._properties = new Map<string, Property>();\r\n\r\n this._properties.set(prop.name.toUpperCase(), prop);\r\n this.cleanCache();\r\n return prop;\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteProperty(name: string): Promise<void> {\r\n if (this._properties) {\r\n const property = await this.getProperty(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deletePropertySync(name: string): void {\r\n if (this._properties) {\r\n const property = this.getPropertySync(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\r\n * all base classes. Set excludeInherited to 'true' to only search the local class.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = await this.buildPropertyCache();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches, case-insensitive, for a local ECProperty with the name provided.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\r\n if (this.baseClass) {\r\n const baseClassObj = await this.baseClass;\r\n return baseClassObj.getProperty(name);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public getInheritedPropertySync(name: string): Property | undefined {\r\n const baseClassObj = this.getBaseClassSync();\r\n if (baseClassObj)\r\n return baseClassObj.getPropertySync(name);\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = await schema.lookupItem(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = schema.lookupItemSync(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\r\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n * Save this Classes properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\r\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\r\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\r\n schemaJson.modifier = classModifierToString(this.modifier);\r\n if (this.baseClass !== undefined)\r\n schemaJson.baseClass = this.baseClass.fullName;\r\n if (this._properties !== undefined && this._properties.size > 0)\r\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\r\n\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson as ClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n if (undefined !== this.modifier)\r\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\r\n\r\n if (undefined !== this.baseClass) {\r\n const baseClass = await this.baseClass;\r\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\r\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\r\n baseClassElement.textContent = baseClassName;\r\n itemElement.appendChild(baseClassElement);\r\n }\r\n\r\n if (this._properties) {\r\n for (const prop of this._properties.values()) {\r\n const propXml = await prop.toXml(schemaXml);\r\n itemElement.appendChild(propXml);\r\n }\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(classProps: ClassProps) {\r\n super.fromJSONSync(classProps);\r\n\r\n if (undefined !== classProps.modifier) {\r\n const modifier = parseClassModifier(classProps.modifier);\r\n if (undefined === modifier) {\r\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\r\n this._modifier = ECClassModifier.None;\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\r\n } else {\r\n this._modifier = modifier;\r\n }\r\n }\r\n\r\n if (undefined !== classProps.baseClass) {\r\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\r\n if (!ecClassSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n\r\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\r\n\r\n let lazyBase: LazyLoadedECClass;\r\n if (!baseClass) {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\r\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n return baseItem;\r\n });\r\n } else {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n return baseClass as ECClass;\r\n });\r\n }\r\n\r\n this._baseClass = lazyBase;\r\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\r\n }\r\n }\r\n\r\n public override async fromJSON(classProps: ClassProps): Promise<void> {\r\n this.fromJSONSync(classProps);\r\n }\r\n\r\n /**\r\n *\r\n * @param customAttribute\r\n *\r\n * @internal\r\n */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /**\r\n * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\r\n * This is essentially a depth-first traversal through the inheritance tree.\r\n */\r\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = await currentSchema!.getItem(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key synchronously\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = currentSchema!.getItemSync(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\nprotected async buildPropertyCache(): Promise<Map<string, Property>> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = await this.baseClass;\r\n if (baseClass) {\r\n for (const property of await baseClass.getProperties()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n}\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected buildPropertyCacheSync(): Map<string, Property> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = this.getBaseClassSync();\r\n if (baseClass) {\r\n for (const property of baseClass.getPropertiesSync()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n * Clears all caches on this object. This is called implicitly for this class,\r\n * but needs to be called if derived classes have changed.\r\n * @internal\r\n */\r\n public cleanCache() {\r\n this._mergedPropertyCache = undefined;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\r\n if (excludeInherited) {\r\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.values();\r\n }\r\n\r\n /**\r\n * Quick way to check whether this class has any local properties without having to use the iterable\r\n */\r\n public get hasLocalProperties(): boolean {\r\n return this._properties !== undefined && this._properties.size > 0;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\r\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\r\n return this.getPropertiesSync(excludeInherited);\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n this.traverseBaseClassesSync((ecClass: ECClass) => {\r\n if (undefined === ecClass.customAttributes)\r\n return false;\r\n\r\n for (const [className, customAttribute] of ecClass.customAttributes) {\r\n if (customAttributes.has(className))\r\n continue;\r\n customAttributes.set(className, customAttribute);\r\n }\r\n\r\n return false;\r\n });\r\n\r\n return customAttributes;\r\n }\r\n\r\n /**\r\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\r\n for await (const baseClass of this.getAllBaseClasses()) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\r\n const baseClasses = this.getAllBaseClassesSync();\r\n if (!baseClasses)\r\n return false;\r\n\r\n for (const baseClass of baseClasses) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the targetClass is of this type.\r\n * @param targetClass The ECClass or ECClass name to check.\r\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\r\n */\r\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\r\n public async is(targetClass: ECClass): Promise<boolean>;\r\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\r\n return typeof targetClass === \"string\"\r\n ? this.isSync(targetClass, schemaName ?? \"\")\r\n : this.isSync(targetClass);\r\n }\r\n\r\n /**\r\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\r\n * @param targetClass The class to check.\r\n */\r\n public isSync(targetClass: ECClass): boolean;\r\n public isSync(targetClass: string, schemaName: string): boolean;\r\n\r\n /** @internal */\r\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\r\n let targetSchemaKey: SchemaItemKey | undefined;\r\n if (schemaName !== undefined) {\r\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\r\n\r\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\r\n if (SchemaItem.equalByKey(this, targetSchemaKey))\r\n return true;\r\n\r\n } else {\r\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\r\n\r\n if (SchemaItem.equalByKey(this, targetClass))\r\n return true;\r\n\r\n targetSchemaKey = targetClass.key;\r\n }\r\n\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n if(baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isECClass(object: any): object is ECClass {\r\n if (!SchemaItem.isSchemaItem(object))\r\n return false;\r\n\r\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\r\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * A setter method for the ECClass modifier, used specifically for schema editing.\r\n * @param modifier\r\n * @internal\r\n */\r\n protected setModifier(modifier: ECClassModifier) {\r\n this._modifier = modifier;\r\n }\r\n}\r\n\r\n/**\r\n * A Typescript class representation of an ECStructClass.\r\n * @public @preview\r\n */\r\nexport class StructClass extends ECClass {\r\n /**\r\n * Get the type of item represented by this instance\r\n */\r\n public override readonly schemaItemType = StructClass.schemaItemType;\r\n\r\n /**\r\n * Get the type of item represented by this class\r\n * @internal\r\n */\r\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\r\n /**\r\n * Type guard to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a StructClass, false otherwise.\r\n */\r\n public static isStructClass(item?: SchemaItem): item is StructClass {\r\n if (item && item.schemaItemType === SchemaItemType.StructClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\r\n if (!this.isStructClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;G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CAAC;IAC5B,CAAC;CACF;AAv1BD,0BAu1BC;AAED;;;GAGG;AACH,MAAa,WAAY,SAAQ,OAAO;IACtC;;OAEG;IACsB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAErE;;;OAGG;IACI,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,WAAW;YAC5D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AAjCD,kCAiCC;AAED;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,OAAO;CA6BjD;AA7BD,oCA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { assert, Logger } from \"@itwin/core-bentley\";\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ClassProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport {\r\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\r\n} from \"./Property\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\n\r\nconst loggingCategory = \"ECClass\";\r\n\r\n/**\r\n * A common abstract class for all of the ECClass types.\r\n * @public @preview\r\n */\r\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\r\n /** @internal */\r\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\r\n private _modifier: ECClassModifier;\r\n private _baseClass?: LazyLoadedECClass;\r\n private _properties?: Map<string, Property>;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n private _mergedPropertyCache?: Map<string, Property>;\r\n\r\n public get modifier() { return this._modifier; }\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name);\r\n\r\n if (modifier)\r\n this._modifier = modifier;\r\n else\r\n this._modifier = ECClassModifier.None;\r\n }\r\n\r\n /**\r\n * Gets the base class if it exists, otherwise returns undefined.\r\n */\r\n public get baseClass(): LazyLoadedECClass | undefined {\r\n return this._baseClass;\r\n }\r\n\r\n public getBaseClassSync(): ECClass | undefined {\r\n if (!this.baseClass) {\r\n return undefined;\r\n }\r\n\r\n return this.schema.lookupItemSync(this.baseClass, ECClass);\r\n }\r\n\r\n /**\r\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\r\n *\r\n * @internal\r\n */\r\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\r\n const oldBaseClass = this._baseClass;\r\n this._baseClass = baseClass;\r\n\r\n if (baseClass)\r\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\r\n else if (oldBaseClass)\r\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\r\n }\r\n\r\n /**\r\n * Gets the derived classes belonging to this class.\r\n * @note This method relies on the `SchemaContext` to find derived classes.\r\n * It will **only** return derived classes from schemas that have already been loaded into the context.\r\n * If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.\r\n * To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`\r\n * before calling this method.\r\n * @returns An array of ECClasses or undefined if no derived classes exist.\r\n */\r\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\r\n const derivedClasses: ECClass[] = [];\r\n for(const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\r\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\r\n if (derivedClass) {\r\n derivedClasses.push(derivedClass);\r\n continue;\r\n }\r\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\r\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\r\n if (derivedClass)\r\n derivedClasses.push(derivedClass);\r\n }\r\n\r\n if (derivedClasses.length === 0)\r\n return undefined;\r\n\r\n return derivedClasses;\r\n }\r\n\r\n /**\r\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\r\n * @param prop The property to add.\r\n * @return The property that was added.\r\n *\r\n * @internal\r\n */\r\n protected addProperty<T extends Property>(prop: T): T {\r\n if (!this._properties)\r\n this._properties = new Map<string, Property>();\r\n\r\n this._properties.set(prop.name.toUpperCase(), prop);\r\n this.cleanCache();\r\n return prop;\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteProperty(name: string): Promise<void> {\r\n if (this._properties) {\r\n const property = await this.getProperty(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deletePropertySync(name: string): void {\r\n if (this._properties) {\r\n const property = this.getPropertySync(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\r\n * all base classes. Set excludeInherited to 'true' to only search the local class.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = await this.buildPropertyCache();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches, case-insensitive, for a local ECProperty with the name provided.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\r\n if (this.baseClass) {\r\n const baseClassObj = await this.baseClass;\r\n return baseClassObj.getProperty(name);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public getInheritedPropertySync(name: string): Property | undefined {\r\n const baseClassObj = this.getBaseClassSync();\r\n if (baseClassObj)\r\n return baseClassObj.getPropertySync(name);\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = await schema.lookupItem(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = schema.lookupItemSync(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\r\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n * Save this Classes properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\r\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\r\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\r\n schemaJson.modifier = classModifierToString(this.modifier);\r\n if (this.baseClass !== undefined)\r\n schemaJson.baseClass = this.baseClass.fullName;\r\n if (this._properties !== undefined && this._properties.size > 0)\r\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\r\n\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson as ClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n if (undefined !== this.modifier)\r\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\r\n\r\n if (undefined !== this.baseClass) {\r\n const baseClass = await this.baseClass;\r\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\r\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\r\n baseClassElement.textContent = baseClassName;\r\n itemElement.appendChild(baseClassElement);\r\n }\r\n\r\n if (this._properties) {\r\n for (const prop of this._properties.values()) {\r\n const propXml = await prop.toXml(schemaXml);\r\n itemElement.appendChild(propXml);\r\n }\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(classProps: ClassProps) {\r\n super.fromJSONSync(classProps);\r\n\r\n if (undefined !== classProps.modifier) {\r\n const modifier = parseClassModifier(classProps.modifier);\r\n if (undefined === modifier) {\r\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\r\n this._modifier = ECClassModifier.None;\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\r\n } else {\r\n this._modifier = modifier;\r\n }\r\n }\r\n\r\n if (undefined !== classProps.baseClass) {\r\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\r\n if (!ecClassSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n\r\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\r\n\r\n let lazyBase: LazyLoadedECClass;\r\n if (!baseClass) {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\r\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n return baseItem;\r\n });\r\n } else {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n return baseClass as ECClass;\r\n });\r\n }\r\n\r\n this._baseClass = lazyBase;\r\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\r\n }\r\n }\r\n\r\n public override async fromJSON(classProps: ClassProps): Promise<void> {\r\n this.fromJSONSync(classProps);\r\n }\r\n\r\n /**\r\n *\r\n * @param customAttribute\r\n *\r\n * @internal\r\n */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /**\r\n * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\r\n * This is essentially a depth-first traversal through the inheritance tree.\r\n */\r\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = await currentSchema!.getItem(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key synchronously\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = currentSchema!.getItemSync(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async buildPropertyCache(): Promise<Map<string, Property>> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = await this.baseClass;\r\n if (baseClass) {\r\n for (const property of await baseClass.getProperties()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected buildPropertyCacheSync(): Map<string, Property> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = this.getBaseClassSync();\r\n if (baseClass) {\r\n for (const property of baseClass.getPropertiesSync()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n * Clears all caches on this object. This is called implicitly for this class,\r\n * but needs to be called if derived classes have changed.\r\n * @internal\r\n */\r\n public cleanCache() {\r\n this._mergedPropertyCache = undefined;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\r\n if (excludeInherited) {\r\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.values();\r\n }\r\n\r\n /**\r\n * Quick way to check whether this class has any local properties without having to use the iterable\r\n */\r\n public get hasLocalProperties(): boolean {\r\n return this._properties !== undefined && this._properties.size > 0;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\r\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\r\n return this.getPropertiesSync(excludeInherited);\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n this.traverseBaseClassesSync((ecClass: ECClass) => {\r\n if (undefined === ecClass.customAttributes)\r\n return false;\r\n\r\n for (const [className, customAttribute] of ecClass.customAttributes) {\r\n if (customAttributes.has(className))\r\n continue;\r\n customAttributes.set(className, customAttribute);\r\n }\r\n\r\n return false;\r\n });\r\n\r\n return customAttributes;\r\n }\r\n\r\n /**\r\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\r\n for await (const baseClass of this.getAllBaseClasses()) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\r\n const baseClasses = this.getAllBaseClassesSync();\r\n if (!baseClasses)\r\n return false;\r\n\r\n for (const baseClass of baseClasses) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the targetClass is of this type.\r\n * @param targetClass The ECClass or ECClass name to check.\r\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\r\n */\r\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\r\n public async is(targetClass: ECClass): Promise<boolean>;\r\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\r\n return typeof targetClass === \"string\"\r\n ? this.isSync(targetClass, schemaName ?? \"\")\r\n : this.isSync(targetClass);\r\n }\r\n\r\n /**\r\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\r\n * @param targetClass The class to check.\r\n */\r\n public isSync(targetClass: ECClass): boolean;\r\n public isSync(targetClass: string, schemaName: string): boolean;\r\n\r\n /** @internal */\r\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\r\n let targetSchemaKey: SchemaItemKey | undefined;\r\n if (schemaName !== undefined) {\r\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\r\n\r\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\r\n if (SchemaItem.equalByKey(this, targetSchemaKey))\r\n return true;\r\n\r\n } else {\r\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\r\n\r\n if (SchemaItem.equalByKey(this, targetClass))\r\n return true;\r\n\r\n targetSchemaKey = targetClass.key;\r\n }\r\n\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n if(baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isECClass(object: any): object is ECClass {\r\n if (!SchemaItem.isSchemaItem(object))\r\n return false;\r\n\r\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\r\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * A setter method for the ECClass modifier, used specifically for schema editing.\r\n * @param modifier\r\n * @internal\r\n */\r\n protected setModifier(modifier: ECClassModifier) {\r\n this._modifier = modifier;\r\n }\r\n}\r\n\r\n/**\r\n * A Typescript class representation of an ECStructClass.\r\n * @public @preview\r\n */\r\nexport class StructClass extends ECClass {\r\n /**\r\n * Get the type of item represented by this instance\r\n */\r\n public override readonly schemaItemType = StructClass.schemaItemType;\r\n\r\n /**\r\n * Get the type of item represented by this class\r\n * @internal\r\n */\r\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\r\n /**\r\n * Type guard to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a StructClass, false otherwise.\r\n */\r\n public static isStructClass(item?: SchemaItem): item is StructClass {\r\n if (item && item.schemaItemType === SchemaItemType.StructClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\r\n if (!this.isStructClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
|
|
@@ -38,6 +38,11 @@ export declare abstract class ECClass extends SchemaItem implements CustomAttrib
|
|
|
38
38
|
protected setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;
|
|
39
39
|
/**
|
|
40
40
|
* Gets the derived classes belonging to this class.
|
|
41
|
+
* @note This method relies on the `SchemaContext` to find derived classes.
|
|
42
|
+
* It will **only** return derived classes from schemas that have already been loaded into the context.
|
|
43
|
+
* If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.
|
|
44
|
+
* To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`
|
|
45
|
+
* before calling this method.
|
|
41
46
|
* @returns An array of ECClasses or undefined if no derived classes exist.
|
|
42
47
|
*/
|
|
43
48
|
getDerivedClasses(): Promise<ECClass[] | undefined>;
|
|
@@ -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,EAAiD,eAAe,EAA0C,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE9L,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EACxI,MAAM,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AE,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"}
|
|
@@ -66,6 +66,11 @@ export class ECClass extends SchemaItem {
|
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Gets the derived classes belonging to this class.
|
|
69
|
+
* @note This method relies on the `SchemaContext` to find derived classes.
|
|
70
|
+
* It will **only** return derived classes from schemas that have already been loaded into the context.
|
|
71
|
+
* If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.
|
|
72
|
+
* To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`
|
|
73
|
+
* before calling this method.
|
|
69
74
|
* @returns An array of ECClasses or undefined if no derived classes exist.
|
|
70
75
|
*/
|
|
71
76
|
async getDerivedClasses() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,cAAc,CAAC;AAC9L,OAAO,EAAE,aAAa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,CAAC,cAAc,KAAK,cAAc,CAAC,oBAAoB,CAAC;IAC1H,CAAC;IAED;;;;OAIG;IACO,WAAW,CAAC,QAAyB;QAC7C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAO;IACtC;;OAEG;IACsB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAErE;;;OAGG;IACI,MAAM,KAAc,cAAc,KAAK,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,WAAW;YAC5D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAE3D;AAED;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,OAAO;CA6BjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { assert, Logger } from \"@itwin/core-bentley\";\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ClassProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport {\r\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\r\n} from \"./Property\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\n\r\nconst loggingCategory = \"ECClass\";\r\n\r\n/**\r\n * A common abstract class for all of the ECClass types.\r\n * @public @preview\r\n */\r\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\r\n /** @internal */\r\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\r\n private _modifier: ECClassModifier;\r\n private _baseClass?: LazyLoadedECClass;\r\n private _properties?: Map<string, Property>;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n private _mergedPropertyCache?: Map<string, Property>;\r\n\r\n public get modifier() { return this._modifier; }\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name);\r\n\r\n if (modifier)\r\n this._modifier = modifier;\r\n else\r\n this._modifier = ECClassModifier.None;\r\n }\r\n\r\n /**\r\n * Gets the base class if it exists, otherwise returns undefined.\r\n */\r\n public get baseClass(): LazyLoadedECClass | undefined {\r\n return this._baseClass;\r\n }\r\n\r\n public getBaseClassSync(): ECClass | undefined {\r\n if (!this.baseClass) {\r\n return undefined;\r\n }\r\n\r\n return this.schema.lookupItemSync(this.baseClass, ECClass);\r\n }\r\n\r\n /**\r\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\r\n *\r\n * @internal\r\n */\r\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\r\n const oldBaseClass = this._baseClass;\r\n this._baseClass = baseClass;\r\n\r\n if (baseClass)\r\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\r\n else if (oldBaseClass)\r\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\r\n }\r\n\r\n /**\r\n * Gets the derived classes belonging to this class.\r\n * @returns An array of ECClasses or undefined if no derived classes exist.\r\n */\r\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\r\n const derivedClasses: ECClass[] = [];\r\n for(const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\r\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\r\n if (derivedClass) {\r\n derivedClasses.push(derivedClass);\r\n continue;\r\n }\r\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\r\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\r\n if (derivedClass)\r\n derivedClasses.push(derivedClass);\r\n }\r\n\r\n if (derivedClasses.length === 0)\r\n return undefined;\r\n\r\n return derivedClasses;\r\n }\r\n\r\n /**\r\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\r\n * @param prop The property to add.\r\n * @return The property that was added.\r\n *\r\n * @internal\r\n */\r\n protected addProperty<T extends Property>(prop: T): T {\r\n if (!this._properties)\r\n this._properties = new Map<string, Property>();\r\n\r\n this._properties.set(prop.name.toUpperCase(), prop);\r\n this.cleanCache();\r\n return prop;\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteProperty(name: string): Promise<void> {\r\n if (this._properties) {\r\n const property = await this.getProperty(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deletePropertySync(name: string): void {\r\n if (this._properties) {\r\n const property = this.getPropertySync(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\r\n * all base classes. Set excludeInherited to 'true' to only search the local class.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = await this.buildPropertyCache();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches, case-insensitive, for a local ECProperty with the name provided.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\r\n if (this.baseClass) {\r\n const baseClassObj = await this.baseClass;\r\n return baseClassObj.getProperty(name);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public getInheritedPropertySync(name: string): Property | undefined {\r\n const baseClassObj = this.getBaseClassSync();\r\n if (baseClassObj)\r\n return baseClassObj.getPropertySync(name);\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = await schema.lookupItem(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = schema.lookupItemSync(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\r\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n * Save this Classes properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\r\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\r\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\r\n schemaJson.modifier = classModifierToString(this.modifier);\r\n if (this.baseClass !== undefined)\r\n schemaJson.baseClass = this.baseClass.fullName;\r\n if (this._properties !== undefined && this._properties.size > 0)\r\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\r\n\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson as ClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n if (undefined !== this.modifier)\r\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\r\n\r\n if (undefined !== this.baseClass) {\r\n const baseClass = await this.baseClass;\r\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\r\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\r\n baseClassElement.textContent = baseClassName;\r\n itemElement.appendChild(baseClassElement);\r\n }\r\n\r\n if (this._properties) {\r\n for (const prop of this._properties.values()) {\r\n const propXml = await prop.toXml(schemaXml);\r\n itemElement.appendChild(propXml);\r\n }\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(classProps: ClassProps) {\r\n super.fromJSONSync(classProps);\r\n\r\n if (undefined !== classProps.modifier) {\r\n const modifier = parseClassModifier(classProps.modifier);\r\n if (undefined === modifier) {\r\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\r\n this._modifier = ECClassModifier.None;\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\r\n } else {\r\n this._modifier = modifier;\r\n }\r\n }\r\n\r\n if (undefined !== classProps.baseClass) {\r\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\r\n if (!ecClassSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n\r\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\r\n\r\n let lazyBase: LazyLoadedECClass;\r\n if (!baseClass) {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\r\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n return baseItem;\r\n });\r\n } else {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n return baseClass as ECClass;\r\n });\r\n }\r\n\r\n this._baseClass = lazyBase;\r\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\r\n }\r\n }\r\n\r\n public override async fromJSON(classProps: ClassProps): Promise<void> {\r\n this.fromJSONSync(classProps);\r\n }\r\n\r\n /**\r\n *\r\n * @param customAttribute\r\n *\r\n * @internal\r\n */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /**\r\n * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\r\n * This is essentially a depth-first traversal through the inheritance tree.\r\n */\r\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = await currentSchema!.getItem(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key synchronously\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = currentSchema!.getItemSync(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\nprotected async buildPropertyCache(): Promise<Map<string, Property>> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = await this.baseClass;\r\n if (baseClass) {\r\n for (const property of await baseClass.getProperties()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n}\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected buildPropertyCacheSync(): Map<string, Property> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = this.getBaseClassSync();\r\n if (baseClass) {\r\n for (const property of baseClass.getPropertiesSync()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n * Clears all caches on this object. This is called implicitly for this class,\r\n * but needs to be called if derived classes have changed.\r\n * @internal\r\n */\r\n public cleanCache() {\r\n this._mergedPropertyCache = undefined;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\r\n if (excludeInherited) {\r\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.values();\r\n }\r\n\r\n /**\r\n * Quick way to check whether this class has any local properties without having to use the iterable\r\n */\r\n public get hasLocalProperties(): boolean {\r\n return this._properties !== undefined && this._properties.size > 0;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\r\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\r\n return this.getPropertiesSync(excludeInherited);\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n this.traverseBaseClassesSync((ecClass: ECClass) => {\r\n if (undefined === ecClass.customAttributes)\r\n return false;\r\n\r\n for (const [className, customAttribute] of ecClass.customAttributes) {\r\n if (customAttributes.has(className))\r\n continue;\r\n customAttributes.set(className, customAttribute);\r\n }\r\n\r\n return false;\r\n });\r\n\r\n return customAttributes;\r\n }\r\n\r\n /**\r\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\r\n for await (const baseClass of this.getAllBaseClasses()) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\r\n const baseClasses = this.getAllBaseClassesSync();\r\n if (!baseClasses)\r\n return false;\r\n\r\n for (const baseClass of baseClasses) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the targetClass is of this type.\r\n * @param targetClass The ECClass or ECClass name to check.\r\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\r\n */\r\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\r\n public async is(targetClass: ECClass): Promise<boolean>;\r\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\r\n return typeof targetClass === \"string\"\r\n ? this.isSync(targetClass, schemaName ?? \"\")\r\n : this.isSync(targetClass);\r\n }\r\n\r\n /**\r\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\r\n * @param targetClass The class to check.\r\n */\r\n public isSync(targetClass: ECClass): boolean;\r\n public isSync(targetClass: string, schemaName: string): boolean;\r\n\r\n /** @internal */\r\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\r\n let targetSchemaKey: SchemaItemKey | undefined;\r\n if (schemaName !== undefined) {\r\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\r\n\r\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\r\n if (SchemaItem.equalByKey(this, targetSchemaKey))\r\n return true;\r\n\r\n } else {\r\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\r\n\r\n if (SchemaItem.equalByKey(this, targetClass))\r\n return true;\r\n\r\n targetSchemaKey = targetClass.key;\r\n }\r\n\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n if(baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isECClass(object: any): object is ECClass {\r\n if (!SchemaItem.isSchemaItem(object))\r\n return false;\r\n\r\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\r\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * A setter method for the ECClass modifier, used specifically for schema editing.\r\n * @param modifier\r\n * @internal\r\n */\r\n protected setModifier(modifier: ECClassModifier) {\r\n this._modifier = modifier;\r\n }\r\n}\r\n\r\n/**\r\n * A Typescript class representation of an ECStructClass.\r\n * @public @preview\r\n */\r\nexport class StructClass extends ECClass {\r\n /**\r\n * Get the type of item represented by this instance\r\n */\r\n public override readonly schemaItemType = StructClass.schemaItemType;\r\n\r\n /**\r\n * Get the type of item represented by this class\r\n * @internal\r\n */\r\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\r\n /**\r\n * Type guard to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a StructClass, false otherwise.\r\n */\r\n public static isStructClass(item?: SchemaItem): item is StructClass {\r\n if (item && item.schemaItemType === SchemaItemType.StructClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\r\n if (!this.isStructClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,cAAc,CAAC;AAC9L,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAY,mBAAmB,EAAE,cAAc,GACxI,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAiB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAgB,OAAQ,SAAQ,UAAU;IAC9C,gBAAgB;IACT,MAAM,KAAc,cAAc,KAA8B,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,wDAAwD;IAC9J,SAAS,CAAkB;IAC3B,UAAU,CAAqB;IAC/B,WAAW,CAAyB;IACpC,iBAAiB,CAAgC;IACjD,oBAAoB,CAAyB;IAErD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B,CAAC,CAAC;IAC5H,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAE3D;AAED;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,OAAO;CA6BjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { assert, Logger } from \"@itwin/core-bentley\";\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ClassProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport {\r\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\r\n} from \"./Property\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\n\r\nconst loggingCategory = \"ECClass\";\r\n\r\n/**\r\n * A common abstract class for all of the ECClass types.\r\n * @public @preview\r\n */\r\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\r\n /** @internal */\r\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\r\n private _modifier: ECClassModifier;\r\n private _baseClass?: LazyLoadedECClass;\r\n private _properties?: Map<string, Property>;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n private _mergedPropertyCache?: Map<string, Property>;\r\n\r\n public get modifier() { return this._modifier; }\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name);\r\n\r\n if (modifier)\r\n this._modifier = modifier;\r\n else\r\n this._modifier = ECClassModifier.None;\r\n }\r\n\r\n /**\r\n * Gets the base class if it exists, otherwise returns undefined.\r\n */\r\n public get baseClass(): LazyLoadedECClass | undefined {\r\n return this._baseClass;\r\n }\r\n\r\n public getBaseClassSync(): ECClass | undefined {\r\n if (!this.baseClass) {\r\n return undefined;\r\n }\r\n\r\n return this.schema.lookupItemSync(this.baseClass, ECClass);\r\n }\r\n\r\n /**\r\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\r\n *\r\n * @internal\r\n */\r\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\r\n const oldBaseClass = this._baseClass;\r\n this._baseClass = baseClass;\r\n\r\n if (baseClass)\r\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\r\n else if (oldBaseClass)\r\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\r\n }\r\n\r\n /**\r\n * Gets the derived classes belonging to this class.\r\n * @note This method relies on the `SchemaContext` to find derived classes.\r\n * It will **only** return derived classes from schemas that have already been loaded into the context.\r\n * If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.\r\n * To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`\r\n * before calling this method.\r\n * @returns An array of ECClasses or undefined if no derived classes exist.\r\n */\r\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\r\n const derivedClasses: ECClass[] = [];\r\n for(const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\r\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\r\n if (derivedClass) {\r\n derivedClasses.push(derivedClass);\r\n continue;\r\n }\r\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\r\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\r\n if (derivedClass)\r\n derivedClasses.push(derivedClass);\r\n }\r\n\r\n if (derivedClasses.length === 0)\r\n return undefined;\r\n\r\n return derivedClasses;\r\n }\r\n\r\n /**\r\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\r\n * @param prop The property to add.\r\n * @return The property that was added.\r\n *\r\n * @internal\r\n */\r\n protected addProperty<T extends Property>(prop: T): T {\r\n if (!this._properties)\r\n this._properties = new Map<string, Property>();\r\n\r\n this._properties.set(prop.name.toUpperCase(), prop);\r\n this.cleanCache();\r\n return prop;\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteProperty(name: string): Promise<void> {\r\n if (this._properties) {\r\n const property = await this.getProperty(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a property from within this class.\r\n * @param name The property name to delete, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deletePropertySync(name: string): void {\r\n if (this._properties) {\r\n const property = this.getPropertySync(name);\r\n if (property) {\r\n this._properties.delete(name.toUpperCase());\r\n this.cleanCache();\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\r\n * all base classes. Set excludeInherited to 'true' to only search the local class.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = await this.buildPropertyCache();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches, case-insensitive, for a local ECProperty with the name provided.\r\n * @param name The name of the property to retrieve.\r\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\r\n */\r\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\r\n const upperKey = name.toUpperCase();\r\n let property: Property | undefined;\r\n\r\n if (this._properties) {\r\n property = this._properties.get(upperKey);\r\n if (property) {\r\n return property;\r\n }\r\n }\r\n\r\n if (excludeInherited) {\r\n return undefined;\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.get(upperKey);\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\r\n if (this.baseClass) {\r\n const baseClassObj = await this.baseClass;\r\n return baseClassObj.getProperty(name);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, for the property with the name provided.\r\n * @param name The name of the inherited property to find.\r\n */\r\n public getInheritedPropertySync(name: string): Property | undefined {\r\n const baseClassObj = this.getBaseClassSync();\r\n if (baseClassObj)\r\n return baseClassObj.getPropertySync(name);\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\r\n *\r\n * @internal\r\n */\r\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n * Creates a PrimitiveArrayECProperty.\r\n * @param name The name of property to create.\r\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\r\n *\r\n * @internal\r\n */\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\r\n if (typeof (propType) === \"number\")\r\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\r\n\r\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of property to create.\r\n * @param structType The struct type of property to create.\r\n *\r\n * @internal\r\n */\r\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\r\n if (await this.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param type\r\n *\r\n * @internal\r\n */\r\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\r\n if (this.getPropertySync(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\r\n\r\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = await schema.lookupItem(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param structType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\r\n let correctType: StructClass | undefined;\r\n if (typeof (structType) === \"string\") {\r\n correctType = schema.lookupItemSync(structType, StructClass);\r\n } else\r\n correctType = structType;\r\n\r\n if (!correctType)\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\r\n\r\n return correctType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\r\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n *\r\n * @param primitiveType\r\n * @param schema\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\r\n if (primitiveType === undefined)\r\n return PrimitiveType.Integer;\r\n\r\n if (typeof (primitiveType) === \"string\") {\r\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\r\n if (!resolvedType) {\r\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\r\n }\r\n\r\n if (resolvedType === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\r\n\r\n return resolvedType;\r\n }\r\n\r\n return primitiveType;\r\n }\r\n\r\n /**\r\n * Save this Classes properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\r\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\r\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\r\n schemaJson.modifier = classModifierToString(this.modifier);\r\n if (this.baseClass !== undefined)\r\n schemaJson.baseClass = this.baseClass.fullName;\r\n if (this._properties !== undefined && this._properties.size > 0)\r\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\r\n\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson as ClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n if (undefined !== this.modifier)\r\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\r\n\r\n if (undefined !== this.baseClass) {\r\n const baseClass = await this.baseClass;\r\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\r\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\r\n baseClassElement.textContent = baseClassName;\r\n itemElement.appendChild(baseClassElement);\r\n }\r\n\r\n if (this._properties) {\r\n for (const prop of this._properties.values()) {\r\n const propXml = await prop.toXml(schemaXml);\r\n itemElement.appendChild(propXml);\r\n }\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(classProps: ClassProps) {\r\n super.fromJSONSync(classProps);\r\n\r\n if (undefined !== classProps.modifier) {\r\n const modifier = parseClassModifier(classProps.modifier);\r\n if (undefined === modifier) {\r\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\r\n this._modifier = ECClassModifier.None;\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\r\n } else {\r\n this._modifier = modifier;\r\n }\r\n }\r\n\r\n if (undefined !== classProps.baseClass) {\r\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\r\n if (!ecClassSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n\r\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\r\n\r\n let lazyBase: LazyLoadedECClass;\r\n if (!baseClass) {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\r\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\r\n return baseItem;\r\n });\r\n } else {\r\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\r\n async () => {\r\n return baseClass as ECClass;\r\n });\r\n }\r\n\r\n this._baseClass = lazyBase;\r\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\r\n }\r\n }\r\n\r\n public override async fromJSON(classProps: ClassProps): Promise<void> {\r\n this.fromJSONSync(classProps);\r\n }\r\n\r\n /**\r\n *\r\n * @param customAttribute\r\n *\r\n * @internal\r\n */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /**\r\n * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\r\n * This is essentially a depth-first traversal through the inheritance tree.\r\n */\r\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = await currentSchema!.getItem(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\r\n if (baseClass)\r\n yield baseClass;\r\n }\r\n }\r\n\r\n /**\r\n * gets a class from this schema or its references recursively using the item key synchronously\r\n * @param itemKey\r\n * @returns ECClass if it could be found, undefined otherwise\r\n * @internal\r\n */\r\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\r\n const schemaList: Schema[] = [this.schema];\r\n while(schemaList.length > 0) {\r\n const currentSchema = schemaList.shift();\r\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\r\n const baseClass = currentSchema!.getItemSync(itemKey.name, ECClass);\r\n schemaList.splice(0); // clear the list\r\n return baseClass;\r\n }\r\n schemaList.push(...currentSchema!.references);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected async buildPropertyCache(): Promise<Map<string, Property>> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = await this.baseClass;\r\n if (baseClass) {\r\n for (const property of await baseClass.getProperties()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected buildPropertyCacheSync(): Map<string, Property> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = this.getBaseClassSync();\r\n if (baseClass) {\r\n for (const property of baseClass.getPropertiesSync()) {\r\n if (!cache.has(property.name.toUpperCase())) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n }\r\n\r\n if (this._properties) {\r\n this._properties.forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n * Clears all caches on this object. This is called implicitly for this class,\r\n * but needs to be called if derived classes have changed.\r\n * @internal\r\n */\r\n public cleanCache() {\r\n this._mergedPropertyCache = undefined;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\r\n if (excludeInherited) {\r\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\r\n }\r\n\r\n if (!this._mergedPropertyCache) {\r\n this._mergedPropertyCache = this.buildPropertyCacheSync();\r\n }\r\n\r\n return this._mergedPropertyCache.values();\r\n }\r\n\r\n /**\r\n * Quick way to check whether this class has any local properties without having to use the iterable\r\n */\r\n public get hasLocalProperties(): boolean {\r\n return this._properties !== undefined && this._properties.size > 0;\r\n }\r\n\r\n /**\r\n * Returns the properties on this class and its base classes.\r\n * Since this is an expensive operation, results will be cached after first call.\r\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\r\n * @returns An array of properties, empty array if none exist.\r\n */\r\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\r\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\r\n return this.getPropertiesSync(excludeInherited);\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current class and its bases.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n this.traverseBaseClassesSync((ecClass: ECClass) => {\r\n if (undefined === ecClass.customAttributes)\r\n return false;\r\n\r\n for (const [className, customAttribute] of ecClass.customAttributes) {\r\n if (customAttributes.has(className))\r\n continue;\r\n customAttributes.set(className, customAttribute);\r\n }\r\n\r\n return false;\r\n });\r\n\r\n return customAttributes;\r\n }\r\n\r\n /**\r\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\r\n for await (const baseClass of this.getAllBaseClasses()) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\r\n * function for each base class encountered.\r\n * @param callback The function to call for each base class in the hierarchy.\r\n * @param arg An argument that will be passed as the second parameter to the callback function.\r\n */\r\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\r\n const baseClasses = this.getAllBaseClassesSync();\r\n if (!baseClasses)\r\n return false;\r\n\r\n for (const baseClass of baseClasses) {\r\n if (callback(baseClass, arg))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the targetClass is of this type.\r\n * @param targetClass The ECClass or ECClass name to check.\r\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\r\n */\r\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\r\n public async is(targetClass: ECClass): Promise<boolean>;\r\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\r\n return typeof targetClass === \"string\"\r\n ? this.isSync(targetClass, schemaName ?? \"\")\r\n : this.isSync(targetClass);\r\n }\r\n\r\n /**\r\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\r\n * @param targetClass The class to check.\r\n */\r\n public isSync(targetClass: ECClass): boolean;\r\n public isSync(targetClass: string, schemaName: string): boolean;\r\n\r\n /** @internal */\r\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\r\n let targetSchemaKey: SchemaItemKey | undefined;\r\n if (schemaName !== undefined) {\r\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\r\n\r\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\r\n if (SchemaItem.equalByKey(this, targetSchemaKey))\r\n return true;\r\n\r\n } else {\r\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\r\n\r\n if (SchemaItem.equalByKey(this, targetClass))\r\n return true;\r\n\r\n targetSchemaKey = targetClass.key;\r\n }\r\n\r\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\r\n if(baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isECClass(object: any): object is ECClass {\r\n if (!SchemaItem.isSchemaItem(object))\r\n return false;\r\n\r\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\r\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * A setter method for the ECClass modifier, used specifically for schema editing.\r\n * @param modifier\r\n * @internal\r\n */\r\n protected setModifier(modifier: ECClassModifier) {\r\n this._modifier = modifier;\r\n }\r\n}\r\n\r\n/**\r\n * A Typescript class representation of an ECStructClass.\r\n * @public @preview\r\n */\r\nexport class StructClass extends ECClass {\r\n /**\r\n * Get the type of item represented by this instance\r\n */\r\n public override readonly schemaItemType = StructClass.schemaItemType;\r\n\r\n /**\r\n * Get the type of item represented by this class\r\n * @internal\r\n */\r\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\r\n /**\r\n * Type guard to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a StructClass, false otherwise.\r\n */\r\n public static isStructClass(item?: SchemaItem): item is StructClass {\r\n if (item && item.schemaItemType === SchemaItemType.StructClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type StructClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\r\n if (!this.isStructClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/ecschema-metadata",
|
|
3
|
-
"version": "5.7.0-dev.
|
|
3
|
+
"version": "5.7.0-dev.5",
|
|
4
4
|
"description": "ECObjects core concepts in typescript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/cjs/ecschema-metadata.js",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"rimraf": "^6.0.1",
|
|
42
42
|
"typescript": "~5.6.2",
|
|
43
43
|
"vitest": "^3.0.6",
|
|
44
|
-
"@itwin/build-tools": "5.7.0-dev.
|
|
45
|
-
"@itwin/core-bentley": "5.7.0-dev.
|
|
46
|
-
"@itwin/core-quantity": "5.7.0-dev.
|
|
44
|
+
"@itwin/build-tools": "5.7.0-dev.5",
|
|
45
|
+
"@itwin/core-bentley": "5.7.0-dev.5",
|
|
46
|
+
"@itwin/core-quantity": "5.7.0-dev.5"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@itwin/core-bentley": "5.7.0-dev.
|
|
50
|
-
"@itwin/core-quantity": "5.7.0-dev.
|
|
49
|
+
"@itwin/core-bentley": "5.7.0-dev.5",
|
|
50
|
+
"@itwin/core-quantity": "5.7.0-dev.5"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|