ECClass Class

A common abstract class for all of the ECClass types.

Extends

Extended by

Implements

Methods

Name Description
constructor(schema: Schema, name: string, modifier?: ECClassModifier): ECClass    
addCustomAttribute(customAttribute: CustomAttribute): void Protected    
addProperty<T extends Property>(prop: T): T Protected Convenience method for adding an already loaded ECProperty used by create*Property methods.  
buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches: booleanfalse): Promise<void> Protected    
buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches: booleanfalse): void Protected    
createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty> Protected Creates a PrimitiveArrayECProperty.  
createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty> Protected    
createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty Protected Creates a PrimitiveArrayECProperty.  
createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty Protected    
createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty> Protected    
createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty> Protected Creates a PrimitiveECProperty.  
createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty Protected    
createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty Protected Creates a PrimitiveECProperty.  
createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> Protected    
createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty Protected    
createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> Protected    
createStructPropertySync(name: string, structType: string | StructClass): StructProperty Protected    
fromJSON(classProps: ClassProps): Promise<void>    
fromJSONSync(classProps: ClassProps): void    
getAllBaseClasses(): AsyncIterableIterator<ECClass, any, any> Iterates (recursively) over all base classes and mixins, in "property override" order.  
getAllBaseClassesSync(): Iterable<AnyClass, any, any>    
getBaseClassSync(): undefined | ECClass    
getCustomAttributes(): Promise<> Retrieve all custom attributes in the current class and its bases  
getCustomAttributesSync(): Retrieve all custom attributes in the current class and its bases.  
getDerivedClasses(): Promise<undefined | ECClass[]> Gets the derived classes belonging to this class.  
getInheritedProperty(name: string): Promise<undefined | Property> Searches the base class, if one exists, for the property with the name provided.  
getInheritedPropertySync(name: string): undefined | Property Searches the base class, if one exists, for the property with the name provided.  
getProperties(resetCache: booleanfalse): Promise<Property[]> Iterates all properties, including the ones merged from base classes and mixins.  
getPropertiesSync(resetCache: booleanfalse): Property[] Iterates all properties, including the ones merged from base classes and mixins.  
getProperty(name: string, includeInherited: booleanfalse): Promise<undefined | Property> Searches, case-insensitive, for a local ECProperty with the name provided.  
getPropertySync(name: string, includeInherited: booleanfalse): undefined | Property Searches, case-insensitive, for a local ECProperty with the name provided.  
is(targetClass: ECClass): Promise<boolean>    
is(targetClass: string, schemaName: string): Promise<boolean> Indicates if the targetClass is of this type.  
isSync(targetClass: ECClass): boolean A synchronous version of the ECClass.is, indicating if the targetClass is of this type.  
loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration, schema: Schema): Promise<PrimitiveType | Enumeration> Protected    
loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration, schema: Schema): PrimitiveType | Enumeration Protected    
loadStructType(structType: string | StructClass, schema: Schema): Promise<StructClass> Protected    
loadStructTypeSync(structType: string | StructClass, schema: Schema): StructClass Protected    
setBaseClass(baseClass: LazyLoadedECClass): Promise<void> Protected Sets the base class of the ECClass.  
toJSON(standalone: booleanfalse, includeSchemaVersion: booleanfalse): ClassProps Save this Classes properties to an object for serializing to JSON.  
traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback  
traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback  
mergeProperties(target: Property[], existingValues: Map<string, number>, propertiesToMerge: Property[], overwriteExisting: boolean): void Protected Static    

Inherited methods

Name Inherited from Description
equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItemKey | SchemaItem): boolean Static Inherited SchemaItem Indicates if the two SchemaItem objects are equal by comparing their respective key properties.
parseFullName(fullName: string): [string, string] Static Inherited SchemaItem Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.

Properties

Name Type Description
_baseClass Protected LazyLoadedECClass | undefined    
_derivedClasses Protected Map<string, LazyLoadedECClass> | undefined    
_modifier Protected ECClassModifier    
_properties Protected Map<string, Property> | undefined    
baseClass Accessor ReadOnly undefined | LazyLoadedECClass Gets the base class if it exists, otherwise returns undefined.  
customAttributes Accessor ReadOnly undefined |    
modifier Accessor ReadOnly ECClassModifier    
properties Accessor ReadOnly undefined | IterableIterator<Property, any, any>    
schemaItemType Accessor Static ReadOnly SupportedSchemaItemType Get the type of item represented by this class  

Inherited properties

Name Type Inherited from Description
_description Protected Inherited string | undefined SchemaItem  
_key Protected Inherited SchemaItemKey SchemaItem  
_label Protected Inherited string | undefined SchemaItem  
description Accessor Inherited ReadOnly undefined | string SchemaItem  
fullName Accessor Inherited ReadOnly string SchemaItem  
key Accessor Inherited ReadOnly SchemaItemKey SchemaItem  
label Accessor Inherited ReadOnly undefined | string SchemaItem  
name Accessor Inherited ReadOnly string SchemaItem  
schema Readonly Inherited Schema SchemaItem  
schemaItemType Accessor Abstract Inherited ReadOnly SchemaItemType SchemaItem Get the type of item represented by this instance

Defined in

Last Updated: 20 February, 2025