ISchema abstract#
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:
- Entity descriptors (IEntityDescriptor)
- Select descriptors (ISelectDescriptor)
- Enumeration descriptors (IEnumDescriptor)
- Type descriptors (ITypeDescriptor)
Each supported schema has exactly one ISchema instance that provides centralized access to all schema metadata and type information.
Inheritance
Object → INullableObject → ISchema
Constructors#
ISchema()#
Properties#
hashCode no setter inherited#
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#
Indicates whether this schema is an IFC (Industry Foundation Classes) schema.
Implementation
bool get isIfc;
isNull no setter inherited#
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#
A representation of the runtime type of the object.
Inherited from Object.
Implementation
external Type get runtimeType;
schemaEnum no setter#
Gets the schema enumeration value identifying this schema.
Implementation
SupportedSchema get schemaEnum;
schemaName no setter#
Gets the formal name of this schema.
Implementation
String get schemaName;
Methods#
addUserDefinedEntityDescriptor()#
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()#
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()#
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()#
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()#
Gets the number of complex entity types defined in this schema.
Implementation
int getComplexEntityDescriptorCount();
getComplexEntityDescriptorIds()#
Gets all complex entity type identifiers in this schema. This is subset of returns from getEntityDescriptorIds.
Implementation
List<int> getComplexEntityDescriptorIds();
getComplexEntityDescriptorIdsWithPartId()#
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()#
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()#
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()#
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()#
Gets the number of entity types defined in this schema.
Implementation
int getEntityDescriptorCount();
getEntityDescriptorIds()#
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()#
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()#
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()#
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()#
Gets the number of enumeration types defined in this schema.
Implementation
int getEnumDescriptorCount();
getEnumDescriptorIds()#
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()#
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()#
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()#
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()#
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()#
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()#
Gets the number of select types defined in this schema.
Implementation
int getSelectDescriptorCount();
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()#
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()#
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()#
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()#
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()#
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()#
Gets the number of defined types in this schema.
Implementation
int getTypeDescriptorCount();
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()#
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()#
Implementation
bool hasEquivalentEntityType(ISchema other, int typeId);
isSubTypeOf()#
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()#
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#
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#
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#
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 == omust be true.-
Symmetric: For all objects
o1ando2,o1 == o2ando2 == o1must either both be true, or both be false. -
Transitive: For all objects
o1,o2, ando3, ifo1 == o2ando2 == o3are true, theno1 == o3must 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);
