Schema Class

Implements

Methods

Name Description
constructor(context: SchemaContext): Schema Constructs an empty Schema (without a SchemaKey) in the provided context.  
constructor(context: SchemaContext, key: SchemaKey, alias: string): Schema Constructs an empty Schema with the given key in the provided context.  
constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number): Schema Constructs an empty Schema with the given name and version in the provided context.  
fromJSON(schemaProps: SchemaProps): Promise<void> Loads the schema header (name, version alias, label and description) from the input SchemaProps  
fromJSONSync(schemaProps: SchemaProps): void Loads the schema header (name, version alias, label and description) from the input SchemaProps  
getConstant(name: string): Promise<undefined | Constant> Shortcut for calling getItem with Constant.  
getCustomAttributeClass(name: string): Promise<undefined | CustomAttributeClass> Shortcut for calling getItem with CustomAttributeClass.  
getEntityClass(name: string): Promise<undefined | EntityClass> Shortcut for calling getItem with EntityClass.  
getEnumeration(name: string): Promise<undefined | Enumeration> Shortcut for calling getItem with Enumeration.  
getFormat(name: string): Promise<undefined | Format> Shortcut for calling getItem with Format.  
getInvertedUnit(name: string): Promise<undefined | InvertedUnit> Shortcut for calling getItem with InvertedUnit.  
getItem(name: string): Promise<undefined | SchemaItem> Gets an item from within this schema.  
getItem<T extends >(name: string, itemConstructor: T): Promise<undefined | InstanceType<T>>    
getItems(): Iterable<SchemaItem, any, any> Returns all of the loaded items in this schema.  
getItems<T extends >(itemConstructor: T): Iterable<InstanceType<T>, any, any>    
getItemSync(name: string): undefined | SchemaItem Gets an item from within this schema.  
getItemSync<T extends >(name: string, itemConstructor: T): undefined | InstanceType<T>    
getKindOfQuantity(name: string): Promise<undefined | KindOfQuantity> Shortcut for calling getItem with KindOfQuantity.  
getMixin(name: string): Promise<undefined | Mixin> Shortcut for calling getItem with Mixin.  
getPhenomenon(name: string): Promise<undefined | Phenomenon> Shortcut for calling getItem with Phenomenon.  
getPropertyCategory(name: string): Promise<undefined | PropertyCategory> Shortcut for calling getItem with PropertyCategory.  
getReference(refSchemaName: string): Promise<undefined | Schema> Gets a referenced schema by name  
getReferenceNameByAlias(alias: string): undefined | string Gets a referenced schema by alias  
getReferenceSync(refSchemaName: string): undefined | Schema Gets a referenced schema by name  
getRelationshipClass(name: string): Promise<undefined | RelationshipClass> Shortcut for calling getItem with RelationshipClass.  
getSchemaItemKey(fullName: string): SchemaItemKey Returns a SchemaItemKey given the item name and the schema it belongs to  
getStructClass(name: string): Promise<undefined | StructClass> Shortcut for calling getItem with StructClass.  
getUnit(name: string): Promise<undefined | Unit> Shortcut for calling getItem with Unit.  
getUnitSystem(name: string): Promise<undefined | UnitSystem> Shortcut for calling getItem with UnitSystem.  
lookupItem(key: string | Readonly<SchemaItemKey>): Promise<undefined | SchemaItem> Attempts to find a schema item within this schema or a (directly) referenced schema  
lookupItem<T extends >(key: string | Readonly<SchemaItemKey>, itemConstructor: T): Promise<undefined | InstanceType<T>>    
lookupItemSync(key: string | Readonly<SchemaItemKey>): undefined | SchemaItem Attempts to find a schema item within this schema or a (directly) referenced schema  
lookupItemSync<T extends >(key: string | Readonly<SchemaItemKey>, itemConstructor: T): undefined | InstanceType<T>    
toJSON(): SchemaProps Save this Schema's properties to an object for serializing to JSON.  
toXml(schemaXml: Document): Promise<Document> Converts the schema to a DOM XML Document.  
fromJson(jsonObj: string | object, context: SchemaContext): Promise<Schema> Static    
fromJsonSync(jsonObj: string | object, context: SchemaContext): Schema Static Completely loads the Schema from the input json.  
startLoadingFromJson(jsonObj: string | object, context: SchemaContext): Promise<SchemaInfo> Static Completely loads the SchemaInfo from the input json and starts loading the entire schema.  

Properties

Name Type Description
alias Accessor ReadOnly string    
context Accessor ReadOnly SchemaContext Returns the schema context this schema is within.  
currentECSpecMajorVersion Accessor Static ReadOnly number    
currentECSpecMinorVersion Accessor Static ReadOnly number    
customAttributes Accessor ReadOnly undefined |    
description Accessor ReadOnly undefined | string    
fullName Accessor ReadOnly string Returns the schema name.  
label Accessor ReadOnly undefined | string    
minorVersion Accessor ReadOnly number    
name Accessor ReadOnly string    
originalECSpecMajorVersion Accessor ReadOnly undefined | number    
originalECSpecMinorVersion Accessor ReadOnly undefined | number    
readVersion Accessor ReadOnly number    
references Readonly Schema[]    
schema Accessor ReadOnly Schema Returns the schema.  
schemaKey Accessor ReadOnly SchemaKey    
writeVersion Accessor ReadOnly number    

Defined in

Last Updated: 23 April, 2025