ISchema
PIComposer APIPIComposer API

ISchema abstract#

abstract class ISchema extends INullableObject

Provides schema definition and description services for EXPRESS schemas.

This interface is the sibling of IObjectFactory. While IObjectFactory is responsible for creating schema element instances, ISchema is responsible for managing the definition and description of schema content, including:

Each supported schema has exactly one ISchema instance that provides centralized access to all schema metadata and type information.

Inheritance

Object → INullableObjectISchema

Constructors#

ISchema()#

ISchema()

Properties#

hashCode no setter inherited#

int get hashCode

The hash code for this object.

A hash code is a single integer which represents the state of the object that affects operator == comparisons.

All objects have hash codes. The default hash code implemented by Object represents only the identity of the object, the same way as the default operator == implementation only considers objects equal if they are identical (see identityHashCode).

If operator == is overridden to use the object state instead, the hash code must also be changed to represent that state, otherwise the object cannot be used in hash based data structures like the default Set and Map implementations.

Hash codes must be the same for objects that are equal to each other according to operator ==. The hash code of an object should only change if the object changes in a way that affects equality. There are no further requirements for the hash codes. They need not be consistent between executions of the same program and there are no distribution guarantees.

Objects that are not equal are allowed to have the same hash code. It is even technically allowed that all instances have the same hash code, but if clashes happen too often, it may reduce the efficiency of hash-based data structures like HashSet or HashMap.

If a subclass overrides hashCode, it should override the operator == operator as well to maintain consistency.

Inherited from Object.

Implementation
external int get hashCode;

isIfc no setter#

bool get isIfc

Indicates whether this schema is an IFC (Industry Foundation Classes) schema.

Implementation
bool get isIfc;

isNull no setter inherited#

bool get isNull

Indicates whether the object represents a null value.

Returns true if the object is considered null according to its implementation, false otherwise.

Inherited from INullableObject.

Implementation
bool get isNull;

runtimeType no setter inherited#

Type get runtimeType

A representation of the runtime type of the object.

Inherited from Object.

Implementation
external Type get runtimeType;

schemaEnum no setter#

SupportedSchema get schemaEnum

Gets the schema enumeration value identifying this schema.

Implementation
SupportedSchema get schemaEnum;

schemaName no setter#

String get schemaName

Gets the formal name of this schema.

Implementation
String get schemaName;

Methods#

addUserDefinedEntityDescriptor()#

IEntityDescriptor addUserDefinedEntityDescriptor( Map<String, dynamic> entityDefinition, );

Adds a user-defined entity type to the schema.

The new entity type will be persisted to storage and available for use in any project within this schema context.

entityDefinition: A map containing the entity definition structure Returns the created IEntityDescriptor, or NullTypeDescriptor if creation failed

Implementation
IEntityDescriptor addUserDefinedEntityDescriptor(
    Map<String, dynamic> entityDefinition);

addUserDefinedEnumDescriptor()#

IEnumDescriptor addUserDefinedEnumDescriptor( Map<String, dynamic> enumDefinition, );

Adds a user-defined enumeration type to the schema.

The new enumeration type will be persisted to storage and available for use in any project within this schema context.

enumDefinition: A map containing the enumeration definition structure Returns the created IEnumDescriptor, or null descriptor if creation failed

Implementation
IEnumDescriptor addUserDefinedEnumDescriptor(
    Map<String, dynamic> enumDefinition);

getAttributeDescriptorOfFundamentalType()#

IAttributeDescriptor getAttributeDescriptorOfFundamentalType( FundamentalType funType, );

Gets or creates an attribute descriptor for a fundamental type.

These descriptors are different from those returned by getTypedAttributeDescriptor and there is exactly one for each FundamentalType.

funType: The fundamental type category Returns the IAttributeDescriptor for the specified fundamental type

Implementation
IAttributeDescriptor getAttributeDescriptorOfFundamentalType(
    FundamentalType funType);

getComplexEntityDescriptor()#

IEntityDescriptor getComplexEntityDescriptor(List<String> types)

Gets a complex entity descriptor from its partial instance types.

Complex entities comprise multiple partial instances that together form a complete entity definition according to EXPRESS schema rules.

types: A list of partial instance type names that form the complex entity Returns the IEntityDescriptor for the complex entity

Implementation
IEntityDescriptor getComplexEntityDescriptor(List<String> types);

getComplexEntityDescriptorCount()#

int getComplexEntityDescriptorCount()

Gets the number of complex entity types defined in this schema.

Implementation
int getComplexEntityDescriptorCount();

getComplexEntityDescriptorIds()#

List<int> getComplexEntityDescriptorIds()

Gets all complex entity type identifiers in this schema. This is subset of returns from getEntityDescriptorIds.

Implementation
List<int> getComplexEntityDescriptorIds();

getComplexEntityDescriptorIdsWithPartId()#

List<int> getComplexEntityDescriptorIdsWithPartId(int part)

Gets all complex entity type identityfier that has the given part in this schema. This is a subset of returns from getComplexEntityDescriptorIds

Implementation
List<int> getComplexEntityDescriptorIdsWithPartId(int part);

getDefinedTypeName()#

String getDefinedTypeName(int typeId)

Gets the defined type name from a type identifier.

typeId: The hash-based type identifier of the defined type Returns the display name of the defined type

Implementation
String getDefinedTypeName(int typeId);

getDescriptor()#

ITypeDescriptor getDescriptor( int typeId, [ FundamentalType hint = FundamentalType.UNKNOWN, ]);

Convenience method to get any descriptor by type identifier.

This synthetic method can return IEntityDescriptor, ISelectDescriptor, IEnumDescriptor, or ITypeDescriptor depending on the type.

typeId: The hash-based type identifier to look up hint: Optional FundamentalType hint to assist in descriptor resolution Returns the appropriate descriptor for the specified type

Implementation
ITypeDescriptor getDescriptor(int typeId,
    [FundamentalType hint = FundamentalType.UNKNOWN]);

getEntityDescriptor()#

IEntityDescriptor getEntityDescriptor(int typeId)

Gets an entity descriptor by its type identifier.

typeId: The hash-based type identifier of the entity Returns the IEntityDescriptor for the specified entity type

Implementation
IEntityDescriptor getEntityDescriptor(int typeId);

getEntityDescriptorCount()#

int getEntityDescriptorCount()

Gets the number of entity types defined in this schema.

Implementation
int getEntityDescriptorCount();

getEntityDescriptorIds()#

List<int> getEntityDescriptorIds(bool includeUserDefined)

Gets all entity type identifiers in this schema.

includeUserDefined: If true, includes user-defined entity types Returns a list of hash-based type identifiers for all entity types, including complex types

Implementation
List<int> getEntityDescriptorIds(bool includeUserDefined);

getEntityDisplayName()#

String getEntityDisplayName(int typeId)

Gets the entity type display anem from a type identifier.

Commonly used in UI components for user-friendly display of entity types.

typeId: The hash-based type identifier of the entity Returns the display name of the entity type

Implementation
String getEntityDisplayName(int typeId);

getEntityName()#

String getEntityName(int typeId)

Gets the entity type name from a type identifier.

Commonly used in UI components for user-friendly display of entity types.

typeId: The hash-based type identifier of the entity Returns the display name of the entity type

Implementation
String getEntityName(int typeId);

getEnumDescriptor()#

IEnumDescriptor getEnumDescriptor(int typeId)

Gets an enumeration descriptor by its type identifier.

typeId: The hash-based type identifier of the enumeration type Returns the IEnumDescriptor for the specified enumeration type

Implementation
IEnumDescriptor getEnumDescriptor(int typeId);

getEnumDescriptorCount()#

int getEnumDescriptorCount()

Gets the number of enumeration types defined in this schema.

Implementation
int getEnumDescriptorCount();

getEnumDescriptorIds()#

List<int> getEnumDescriptorIds(bool includeUserDefined)

Gets all enumeration type identifiers in this schema.

includeUserDefined: If true, includes user-defined enumeration types Returns a list of hash-based type identifiers for all enumeration types

Implementation
List<int> getEnumDescriptorIds(bool includeUserDefined);

getEnumName()#

String getEnumName(int typeId)

Gets the enumeration type name from a type identifier.

typeId: The hash-based type identifier of the enumeration type Returns the display name of the enumeration type

Implementation
String getEnumName(int typeId);

getRelatedAttributeIndex()#

int getRelatedAttributeIndex(int typeId)

IFC relation-specific interface: Gets the attribute index for the related side.

typeId: The hash-based type identifier of the IFC relation entity Returns the attribute index for the related object reference

Implementation
int getRelatedAttributeIndex(int typeId);

getRelatingAttributeIndex()#

int getRelatingAttributeIndex(int typeId)

IFC relation-specific interface: Gets the attribute index for the relating side.

typeId: The hash-based type identifier of the IFC relation entity Returns the attribute index for the relating object reference

Implementation
int getRelatingAttributeIndex(int typeId);

getRelationCharacteristics()#

RelationCharacteristics getRelationCharacteristics(int typeId)

Gets the relation characteristics for an IFC relation object.

typeId: The hash-based type identifier of the IFC relation entity Returns the RelationCharacteristics for the specified relation type

Implementation
RelationCharacteristics getRelationCharacteristics(int typeId);

getSelectDescriptor()#

ISelectDescriptor getSelectDescriptor(int typeId)

Gets a select descriptor by its type identifier.

typeId: The hash-based type identifier of the select type Returns the ISelectDescriptor for the specified select type

Implementation
ISelectDescriptor getSelectDescriptor(int typeId);

getSelectDescriptorCount()#

int getSelectDescriptorCount()

Gets the number of select types defined in this schema.

Implementation
int getSelectDescriptorCount();

getSelectDescriptorIds()#

List<int> getSelectDescriptorIds()

Gets all select type identifiers in this schema.

Returns a list of hash-based type identifiers for all select types

Implementation
List<int> getSelectDescriptorIds();

getSelectName()#

String getSelectName(int typeId)

Gets the select type name from a type identifier.

typeId: The hash-based type identifier of the select type Returns the display name of the select type

Implementation
String getSelectName(int typeId);

getSubtypesOf()#

List<int> getSubtypesOf(int type)

Gets all direct and indirect subtypes of a given type.

type: The hash-based type identifier of the supertype Returns a list of type identifiers for all subtypes

Implementation
List<int> getSubtypesOf(int type);

getSupertypesOf()#

List<int> getSupertypesOf(int type)

Gets all direct and indirect supertypes of a given type.

type: The hash-based type identifier of the subtype Returns a list of type identifiers for all supertypes

Implementation
List<int> getSupertypesOf(int type);

getTypedAttributeDescriptor()#

IAttributeDescriptor getTypedAttributeDescriptor(int typeId)

Gets or creates an attribute descriptor for a given type.

There is exactly one attribute descriptor for each type in the schema.

typeId: The hash-based type identifier Returns the IAttributeDescriptor for the specified type

Implementation
IAttributeDescriptor getTypedAttributeDescriptor(int typeId);

getTypeDescriptor()#

ITypeDescriptor getTypeDescriptor(int typeId)

Gets a defined type descriptor by its type identifier.

typeId: The hash-based type identifier of the defined type Returns the ITypeDescriptor for the specified defined type

Implementation
ITypeDescriptor getTypeDescriptor(int typeId);

getTypeDescriptorCount()#

int getTypeDescriptorCount()

Gets the number of defined types in this schema.

Implementation
int getTypeDescriptorCount();

getTypeDescriptorIds()#

List<int> getTypeDescriptorIds()

Gets all defined type identifiers in this schema.

Returns a list of hash-based type identifiers for all defined types

Implementation
List<int> getTypeDescriptorIds();

getTypeName()#

String getTypeName(int typeId)

Gets the type name for any schema type identifier.

Convenience method that works with any descriptor type (entity, select, enum, or defined type).

typeId: The hash-based type identifier to look up Returns the display name of the type

Implementation
String getTypeName(int typeId);

hasEquivalentEntityType()#

bool hasEquivalentEntityType(ISchema other, int typeId)
Implementation
bool hasEquivalentEntityType(ISchema other, int typeId);

isSubTypeOf()#

bool isSubTypeOf(int first, int second)

Checks if the first type is a subtype of the second type.

first: The potential subtype identifier second: The potential supertype identifier Returns true if first is a subtype of second, false otherwise

Implementation
bool isSubTypeOf(int first, int second);

isSuperTypeOf()#

bool isSuperTypeOf(int first, int second)

Checks if the first type is a supertype of the second type.

first: The potential supertype identifier second: The potential subtype identifier Returns true if first is a supertype of second, false otherwise

Implementation
bool isSuperTypeOf(int first, int second);

noSuchMethod() inherited#

dynamic noSuchMethod(Invocation invocation)

Invoked when a nonexistent method or property is accessed.

A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:

dynamic object = 1;
object.add(42); // Statically allowed, run-time error

This invalid code will invoke the noSuchMethod method of the integer 1 with an Invocation representing the .add(42) call and arguments (which then throws).

Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.

A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:

class MockList<T> implements List<T> {
  noSuchMethod(Invocation invocation) {
    log(invocation);
    super.noSuchMethod(invocation); // Will throw.
  }
}
void main() {
  MockList().add(42);
}

This code has no compile-time warnings or errors even though the MockList class has no concrete implementation of any of the List interface methods. Calls to List methods are forwarded to noSuchMethod, so this code will log an invocation similar to Invocation.method(#add, [42]) and then throw.

If a value is returned from noSuchMethod, it becomes the result of the original invocation. If the value is not of a type that can be returned by the original invocation, a type error occurs at the invocation.

The default behavior is to throw a NoSuchMethodError.

Inherited from Object.

Implementation
@pragma("vm:entry-point")
@pragma("wasm:entry-point")
external dynamic noSuchMethod(Invocation invocation);

toString() inherited#

String toString()

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Inherited from Object.

Implementation
external String toString();

Operators#

operator ==() inherited#

bool operator ==(Object other)

The equality operator.

The default behavior for all Objects is to return true if and only if this object and other are the same object.

Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:

  • Total: It must return a boolean for all arguments. It should never throw.

  • Reflexive: For all objects o, o == o must be true.

  • Symmetric: For all objects o1 and o2, o1 == o2 and o2 == o1 must either both be true, or both be false.

  • Transitive: For all objects o1, o2, and o3, if o1 == o2 and o2 == o3 are true, then o1 == o3 must be true.

The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.

If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.

Inherited from Object.

Implementation
external bool operator ==(Object other);