Documentation Language: Swift

Protocol

IModel

Protocol abstracting model access for transformation engines.

protocol IModel : Sendable

Overview

The IModel interface provides a framework-agnostic way to access and manipulate models, similar to Eclipse ATL’s IModel. This abstraction allows transformation engines to work with different modelling frameworks whilst maintaining consistent semantics.

Design Principles

Usage Example

let sourceModel: IModel = EcoreModel(resource: sourceResource, isTarget: false)
let targetModel: IModel = EcoreModel(resource: targetResource, isTarget: true)

let elements = sourceModel.getElementsByType(personClass)
let newPerson = try targetModel.createElement(ofType: personClass)

Topics

Instance Properties

V
isTarget

Indicates if this model allows modifications.

V
referenceModel

The reference model (metamodel) for this model.

V
resource

The underlying resource containing the model elements.

Instance Methods

F
createElement(ofType:)

Creates a new element of the specified metatype.

F
getElementsByType(_:)

Returns all elements matching the given type.

F
isModelOf(_:)

Checks if an object belongs to this model.

Relationships

Inherits From

Inherited By

Conforming Types

See Also

Query and Execution

?
ECoreExecutionEngine

Core execution engine providing model navigation and query capabilities.

S
ECoreQuery

Query framework for ECore models inspired by OCL.