Documentation Language: Swift

Structure

EClass

A class in the Ecore metamodel.

struct EClass

Overview

Represents a class definition in the metamodel, similar to a class declaration in object-oriented programming languages. It defines the structure and behaviour of model objects through structural features, operations, and inheritance relationships.

Overview

EClass serves as the primary metaclass type in Ecore, defining:

Creating Classes

Create an EClass using the designated initialiser:

let person = EClass(
    name: "Person",
    isAbstract: false,
    structuralFeatures: [
        // Features would be added here
    ]
)

Inheritance Hierarchy

Classes can extend multiple supertypes through the eSuperTypes property. The allSuperTypes computed property provides the complete inheritance hierarchy including transitive supertypes.

Feature Access

Structural features can be accessed by name using getStructuralFeature(name:) or filtered by type using allAttributes and allReferences.

Topics

Operators

?
==(_:_:)

Compare two classes for equality.

Initializers

?
init(object:shouldIgnoreUnresolvedFeatures:)

Initialise an EClass from a DynamicEObject.

Instance Properties

V
allAttributes

Retrieve all attributes including inherited ones.

V
allContainments

Retrieve all containment references including inherited ones.

V
allReferences

Retrieve all references including inherited ones.

V
allStructuralFeatures

Retrieve all structural features including inherited ones.

V
allSuperTypes

Retrieve all supertypes including transitive ones.

V
eAnnotations

Annotations attached to this class.

V
eClass

The metaclass describing this class.

V
eOperations

The operations (methods) defined on this class.

V
eStructuralFeatures

The structural features (attributes and references) defined on this class.

V
eSuperTypes

The direct supertypes of this class.

V
id

Unique identifier for this class.

V
isAbstract

Whether this class is abstract.

V
isInterface

Whether this class represents an interface.

V
name

The name of this class.

Instance Methods

F
eGet(_:)

Reflectively retrieve the value of a feature.

F
eIsSet(_:)

Check whether a feature has been explicitly set.

F
eSet(_:_:)

Reflectively set the value of a feature.

F
eUnset(_:)

Unset a feature, returning it to its default value.

F
getEAttribute(name:)

Retrieve an attribute by name.

F
getEReference(name:)

Retrieve a reference by name.

F
getStructuralFeature(name:)

Retrieve a structural feature by name.

F
hash(into:)

Hash the essential components of this class.

F
isSuperTypeOf(_:)

Check if this class is a supertype of another class.

Type Aliases

T
EClass.Classifier

The type of classifier for this class.

Default Implementations

Relationships

Conforms To

See Also

Core Types

P
EObject

Base protocol for all Ecore model elements.

S
DynamicEObject

A dynamic implementation of EObject that stores feature values generically.

S
EPackage

A package in the Ecore metamodel.