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:
-
Single-valued:
lowerBound: 0, upperBound: 1 -
Required:
lowerBound: 1, upperBound: 1 -
Multi-valued:
upperBound: -1(unbounded)
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
Initialise an EAttribute from a DynamicEObject.
Instance Properties
Whether this attribute can be modified.
The default value for this attribute as a string literal.
Annotations attached to this attribute.
The metaclass describing this attribute.
The data type of this attribute.
Unique identifier for this attribute.
Whether this attribute serves as an identifier.
Whether this attribute is multi-valued.
Whether this attribute is required.
The lower bound of this attribute’s multiplicity.
The name of this attribute.
Whether this attribute is transient.
The upper bound of this attribute’s multiplicity.
Whether this attribute has a volatile value.
Instance Methods
Reflectively retrieves the value of a feature.
Checks whether a feature has been explicitly set.
Reflectively sets the value of a feature.
Unsets a feature, returning it to its default value.
Hashes the essential components of this attribute.
Type Aliases
The type of classifier for this attribute.
Default Implementations
Relationships
Conforms To
See Also
Structural Features
A structural feature (attribute or reference) in the Ecore metamodel.
A reference in the Ecore metamodel.