ReferenceAccessor

class ReferenceAccessor[M]
Children
Members defined in ReferenceAccessor (4 members)

element

R

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.

modifiable

R

Returns True if this reference can be modified, that is the owning Relationship is an owned member of a Namespace. Calling set methods when modifiable == False will raise ValueError.

set

try_set but instead raises ValueError if this reference cannot be modified.

try_set

Try changing the referenced element. Returns None if this reference cannot be modified, otherwise returns element argument.

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 True if this reference can be modified, that is the owning Relationship is an owned member of a Namespace. Calling set methods when modifiable == False will raise ValueError.

Methods

set(element: syside.M, name: syside.NameID = ...) syside.M

try_set but instead raises ValueError if this reference cannot be modified.

try_set(element: syside.M, name: syside.NameID = ...) syside.M | None

Try changing the referenced element. Returns None if this reference cannot be modified, otherwise returns element argument.