Documentation Language: Swift

Structure

EAttribute

An attribute in the Ecore metamodel.

struct EAttribute

Overview

Attributes represent data-valued properties of a class, holding primitive or data type values such as strings, numbers, dates, or enumerations. Unlike references, attributes do not point to other objects.

Example

let nameAttribute = EAttribute(
    name: "name",
    eType: EDataType(name: "EString"),
    lowerBound: 1  // Required attribute
)

Multiplicity

Attributes support multiplicity through lowerBound and upperBound:

ID Attributes

An attribute marked with isID set to true uniquely identifies instances within their container, similar to primary keys in databases.

Topics

Operators

?
==(_:_:)

Compares two attributes for equality.

Initializers

Instance Properties

V
changeable

Whether this attribute can be modified.

V
defaultValueLiteral

The default value for this attribute as a string literal.

V
eAnnotations

Annotations attached to this attribute.

V
eClass

The metaclass describing this attribute.

V
eType

The data type of this attribute.

V
id

Unique identifier for this attribute.

V
isID

Whether this attribute serves as an identifier.

V
isMany

Whether this attribute is multi-valued.

V
isRequired

Whether this attribute is required.

V
lowerBound

The lower bound of this attribute’s multiplicity.

V
name

The name of this attribute.

V
transient

Whether this attribute is transient.

V
upperBound

The upper bound of this attribute’s multiplicity.

V
volatile

Whether this attribute has a volatile value.

Instance Methods

F
eGet(_:)

Reflectively retrieves the value of a feature.

F
eIsSet(_:)

Checks whether a feature has been explicitly set.

F
eSet(_:_:)

Reflectively sets the value of a feature.

F
eUnset(_:)

Unsets a feature, returning it to its default value.

F
hash(into:)

Hashes the essential components of this attribute.

Type Aliases

T
EAttribute.Classifier

The type of classifier for this attribute.

Default Implementations

Relationships

Conforms To

See Also

Structural Features

P
EStructuralFeature

A structural feature (attribute or reference) in the Ecore metamodel.

S
EReference

A reference in the Ecore metamodel.