Zum Hauptinhalt springen

ICkSerializer

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.Serialization

Interface for a serializer for the CK model

public interface ICkSerializer

Methods​

SerializeAsync(StreamWriter, CkModelConfigDto)​

Serializes the model configuration to the stream.

Task SerializeAsync(StreamWriter streamWriter, CkModelConfigDto modelConfig)

Parameters​

streamWriter StreamWriter
A stream ready to write used for serialization

modelConfig CkModelConfigDto
Model configuration to serialize

Returns​

Task

SerializeAsync(StreamWriter, CkCompiledModelRoot)​

Serializes the compiled model to the stream.

Task SerializeAsync(StreamWriter streamWriter, CkCompiledModelRoot compiledModel)

Parameters​

streamWriter StreamWriter
A stream ready to write used for serialization

compiledModel CkCompiledModelRoot
Model to serialize

Returns​

Task

SerializeAsync(StreamWriter, CkMetaRootDto)​

Serializes the metadata to the stream.

Task SerializeAsync(StreamWriter streamWriter, CkMetaRootDto metaRootDto)

Parameters​

streamWriter StreamWriter
A stream ready to write used for serialization

metaRootDto CkMetaRootDto
Model to serialize

Returns​

Task

SerializeAsync(StreamWriter, CkElementsRootDto)​

Serializes the elements to the stream.

Task SerializeAsync(StreamWriter streamWriter, CkElementsRootDto elementsRootDto)

Parameters​

streamWriter StreamWriter
A stream ready to write used for serialization

elementsRootDto CkElementsRootDto
Model to serialize

Returns​

Task

DeserializeModelConfigAsync(Stream, String, OperationResult)​

Deserializes the model configuration from the stream.

Task<CkModelConfigDto> DeserializeModelConfigAsync(Stream stream, string locationReference, OperationResult operationResult)

Parameters​

stream Stream
The stream to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

Task<CkModelConfigDto>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeMetaAsync(Stream, String, OperationResult)​

Deserializes the meta data from the stream.

Task<CkMetaRootDto> DeserializeMetaAsync(Stream stream, string locationReference, OperationResult operationResult)

Parameters​

stream Stream
The stream to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

Task<CkMetaRootDto>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeElementsAsync(Stream, String, OperationResult)​

Deserializes the elements from the stream.

Task<CkElementsRootDto> DeserializeElementsAsync(Stream stream, string locationReference, OperationResult operationResult)

Parameters​

stream Stream
The stream to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

Task<CkElementsRootDto>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRootAsync(String, String, OperationResult)​

Deserializes the compiled model from a string.

Task<CkCompiledModelRoot> DeserializeCompiledModelRootAsync(string s, string locationReference, OperationResult operationResult)

Parameters​

s String
The text containing the construction kit to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

Task<CkCompiledModelRoot>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRootAsync(String, String, OperationResult, Boolean)​

Deserializes the compiled model from a string with optional tolerance for unknown properties.

Task<CkCompiledModelRoot> DeserializeCompiledModelRootAsync(string s, string locationReference, OperationResult operationResult, bool tolerantToUnknownProperties)

Parameters​

s String
The text containing the construction kit to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

tolerantToUnknownProperties Boolean
When true, properties that violate the schema's `additionalProperties: false` constraint are silently dropped instead of failing the read. Other schema violations still fail. Use for forward-compatible reads from persisted catalogs after schema evolution removed properties; never use on the publish/compile path.

Returns​

Task<CkCompiledModelRoot>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRoot(String, String, OperationResult)​

Deserializes the compiled model from a string.

CkCompiledModelRoot DeserializeCompiledModelRoot(string s, string locationReference, OperationResult operationResult)

Parameters​

s String
The text containing the construction kit to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

CkCompiledModelRoot
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRoot(String, String, OperationResult, Boolean)​

Deserializes the compiled model from a string with optional tolerance for unknown properties.

CkCompiledModelRoot DeserializeCompiledModelRoot(string s, string locationReference, OperationResult operationResult, bool tolerantToUnknownProperties)

Parameters​

s String
The text containing the construction kit to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

tolerantToUnknownProperties Boolean
See ICkSerializer.DeserializeCompiledModelRootAsync(String, String, OperationResult, Boolean).

Returns​

CkCompiledModelRoot
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRootAsync(Stream, String, OperationResult)​

Deserializes the compiled model from the stream.

Task<CkCompiledModelRoot> DeserializeCompiledModelRootAsync(Stream stream, string locationReference, OperationResult operationResult)

Parameters​

stream Stream
The stream to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

Returns​

Task<CkCompiledModelRoot>
The deserialized object. Please check the for validation issues in operationResult.

DeserializeCompiledModelRootAsync(Stream, String, OperationResult, Boolean)​

Deserializes the compiled model from the stream with optional tolerance for unknown properties.

Task<CkCompiledModelRoot> DeserializeCompiledModelRootAsync(Stream stream, string locationReference, OperationResult operationResult, bool tolerantToUnknownProperties)

Parameters​

stream Stream
The stream to read

locationReference String
A reference used in messages to signal the position of a file or resource

operationResult OperationResult
A operation result object that lists all validation issues. In case of exceptions this object contains the validation errors too.

tolerantToUnknownProperties Boolean
See ICkSerializer.DeserializeCompiledModelRootAsync(String, String, OperationResult, Boolean).

Returns​

Task<CkCompiledModelRoot>
The deserialized object. Please check the for validation issues in operationResult.