ReferenceAccessor
- class ReferenceAccessor[M]
A generic accessor for references in the model
Children
Members defined in
ReferenceAccessor(4 members)
RReturns the referenced
Element.
RReturns
Trueif this reference can be modified, that is the owningRelationshipis an owned member of aNamespace.
try_setbut instead raisesValueErrorif this reference cannot be modified.
Try changing the referenced
element. ReturnsNoneif this reference cannot be modified, otherwise returnselementargument. Attributes
- property element: syside.Element | None
Returns the referenced
Element.This may return
None, e.g. when reference resolution failed, although in most such cases a placeholder element will be returned instead.
- property modifiable: bool
Returns
Trueif this reference can be modified, that is the owningRelationshipis an owned member of aNamespace.Calling
setmethods whenmodifiable == Falsewill raiseValueError.
Methods
- set(element: syside.M, name: syside.NameID = ...) syside.M
try_setbut instead raisesValueErrorif this reference cannot be modified.
- try_set(element: syside.M, name: syside.NameID = ...) syside.M | None
Try changing the referenced
element. ReturnsNoneif this reference cannot be modified, otherwise returnselementargument.