Class
ATLResource
A resource for managing ATL modules with XMI serialization support.
@MainActor final class ATLResource
Overview
ATLResource provides a container for ATL modules that integrates with the ECore resource framework. It enables loading and saving ATL modules in Eclipse ATL XMI format, supporting full roundtrip serialization.
Overview
ATL resources manage:
-
ATL Modules: The transformation specification including rules, helpers, and queries
-
Metamodel References: References to source and target metamodels (EPackages)
-
XMI Serialization: Proper Eclipse ATL XMI format compliance
Architecture
ATLResource composes an ECore Resource actor for managing metamodel references while providing MainActor-isolated access to the ATL module. This design allows:
-
Thread-safe metamodel management through the Resource actor
-
Main-thread coordination for ATL module access
-
Integration with ECore ResourceSet for cross-resource references
Example Usage
// Create a resource for an ATL module
let resource = ATLResource(uri: "file:///transformations/Book2Publication.atl")
// Load from XMI
try await resource.load()
if let module = resource.module {
print("Loaded module: \(module.name)")
}
// Save to XMI
try await resource.save()
Topics
Initializers
Creates a new ATL resource with the specified URI.
Creates a new ATL resource with an ATL module.
Instance Properties
The underlying ECore resource for managing metamodel references.
The ATL module contained in this resource.
The resource set that owns this resource, if any.
The URI identifying this resource.
Instance Methods
Loads the ATL module from its URI.
Saves the ATL module to its URI.
Sets the resource set that owns this resource.