Deserializer
- class Deserializer
Deserializer for SysML models. The actual deserialization input depends on used
Reader.Note that unlike
Serializerdeserialization cannot be completed in a single pass in general because documents may form reference cycles with each other. The typical deserialization pattern will bedes = Deserializer(document) model, report = des.accept(reader, DESERIALIZE_STANDARD) # ... collect all valid element ids for linking link_report, all_linked = model.link(my_reference_resolve)
Members defined in
Deserializer(4 members)
RThe document bound to this deserializer
Construct a new deserializer that will deserialize models into the provided
document.
Accept a
readerfor deserialization into currently bounddocument. Returns the deserialized model, or raises aRuntimeError.documentwithout aUrlwith scheme will emit a warning that relative URIs will not be resolvable.
Reset the deserializer. Rebinds to the
documentand resets thisDeserializerfor new deserialization. Attributes
- property document: syside.Document
The document bound to this deserializer
Methods
- __init__(document: syside.Document) None
Construct a new deserializer that will deserialize models into the provided
document.
- accept(reader: syside.Reader, attributes: syside.AttributeMap) tuple[syside.DeserializedModel, syside.SerdeReport[syside.DocumentSegment | str | syside.Element]]
Accept a
readerfor deserialization into currently bounddocument. Returns the deserialized model, or raises aRuntimeError.documentwithout aUrlwith scheme will emit a warning that relative URIs will not be resolvable.Note that cross-references may not be resolved, and instead replaced by placeholder element references due to potential reference cycles between documents. Call
linkon the returned model when dependent documents have been loaded.
- accept(document: syside.Document, reader: syside.Reader, attributes: syside.AttributeMap) tuple[syside.DeserializedModel, syside.SerdeReport[syside.DocumentSegment | str | syside.Element]]
Accept
readerfor deserialization intodocument. Equivalent todeserializer.reset(document) return deserializer.accept(reader, attributes)
Returns the deserialized model, or raises
RuntimeError.
- reset(document: syside.Document) None
Reset the deserializer. Rebinds to the
documentand resets thisDeserializerfor new deserialization.