jsonization

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package jsonization de/serializes model instances to and from JSON.

We can not use one-pass deserialization for JSON since the object properties do not have fixed order, and hence we can not read `modelType` property ahead of the remaining properties.

To de-serialize, call one of the `*FromJsonable` functions.

To serialize, call ToJsonable function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AASSubmodelElementsFromJsonable

func AASSubmodelElementsFromJsonable(
	jsonable interface{},
) (result aastypes.AASSubmodelElements, err error)

Parse `jsonable` as a literal of aastypes.AASSubmodelElements, or return an error.

func AASSubmodelElementsToJsonable

func AASSubmodelElementsToJsonable(
	that aastypes.AASSubmodelElements,
) (result string, err error)

Serialize `that` to a string, or return an error.

func AbstractLangStringFromJsonable

func AbstractLangStringFromJsonable(
	jsonable interface{},
) (
	result aastypes.IAbstractLangString,
	err error,
)

Parse `jsonable` as an instance of aastypes.IAbstractLangString, or return an error.

func AdministrativeInformationFromJsonable

func AdministrativeInformationFromJsonable(
	jsonable interface{},
) (
	result aastypes.IAdministrativeInformation,
	err error,
)

Parse `jsonable` as an instance of aastypes.IAdministrativeInformation, or return an error.

func AnnotatedRelationshipElementFromJsonable

func AnnotatedRelationshipElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IAnnotatedRelationshipElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IAnnotatedRelationshipElement, or return an error.

func AssetAdministrationShellFromJsonable

func AssetAdministrationShellFromJsonable(
	jsonable interface{},
) (
	result aastypes.IAssetAdministrationShell,
	err error,
)

Parse `jsonable` as an instance of aastypes.IAssetAdministrationShell, or return an error.

func AssetInformationFromJsonable

func AssetInformationFromJsonable(
	jsonable interface{},
) (
	result aastypes.IAssetInformation,
	err error,
)

Parse `jsonable` as an instance of aastypes.IAssetInformation, or return an error.

func AssetKindFromJsonable

func AssetKindFromJsonable(
	jsonable interface{},
) (result aastypes.AssetKind, err error)

Parse `jsonable` as a literal of aastypes.AssetKind, or return an error.

func AssetKindToJsonable

func AssetKindToJsonable(
	that aastypes.AssetKind,
) (result string, err error)

Serialize `that` to a string, or return an error.

func BasicEventElementFromJsonable

func BasicEventElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IBasicEventElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IBasicEventElement, or return an error.

func BlobFromJsonable

func BlobFromJsonable(
	jsonable interface{},
) (
	result aastypes.IBlob,
	err error,
)

Parse `jsonable` as an instance of aastypes.IBlob, or return an error.

func CapabilityFromJsonable

func CapabilityFromJsonable(
	jsonable interface{},
) (
	result aastypes.ICapability,
	err error,
)

Parse `jsonable` as an instance of aastypes.ICapability, or return an error.

func ConceptDescriptionFromJsonable

func ConceptDescriptionFromJsonable(
	jsonable interface{},
) (
	result aastypes.IConceptDescription,
	err error,
)

Parse `jsonable` as an instance of aastypes.IConceptDescription, or return an error.

func DataElementFromJsonable

func DataElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IDataElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IDataElement, or return an error.

func DataSpecificationContentFromJsonable

func DataSpecificationContentFromJsonable(
	jsonable interface{},
) (
	result aastypes.IDataSpecificationContent,
	err error,
)

Parse `jsonable` as an instance of aastypes.IDataSpecificationContent, or return an error.

func DataSpecificationIEC61360FromJsonable

func DataSpecificationIEC61360FromJsonable(
	jsonable interface{},
) (
	result aastypes.IDataSpecificationIEC61360,
	err error,
)

Parse `jsonable` as an instance of aastypes.IDataSpecificationIEC61360, or return an error.

func DataTypeDefXSDFromJsonable

func DataTypeDefXSDFromJsonable(
	jsonable interface{},
) (result aastypes.DataTypeDefXSD, err error)

Parse `jsonable` as a literal of aastypes.DataTypeDefXSD, or return an error.

func DataTypeDefXSDToJsonable

func DataTypeDefXSDToJsonable(
	that aastypes.DataTypeDefXSD,
) (result string, err error)

Serialize `that` to a string, or return an error.

func DataTypeIEC61360FromJsonable

func DataTypeIEC61360FromJsonable(
	jsonable interface{},
) (result aastypes.DataTypeIEC61360, err error)

Parse `jsonable` as a literal of aastypes.DataTypeIEC61360, or return an error.

func DataTypeIEC61360ToJsonable

func DataTypeIEC61360ToJsonable(
	that aastypes.DataTypeIEC61360,
) (result string, err error)

Serialize `that` to a string, or return an error.

func DirectionFromJsonable

func DirectionFromJsonable(
	jsonable interface{},
) (result aastypes.Direction, err error)

Parse `jsonable` as a literal of aastypes.Direction, or return an error.

func DirectionToJsonable

func DirectionToJsonable(
	that aastypes.Direction,
) (result string, err error)

Serialize `that` to a string, or return an error.

func EmbeddedDataSpecificationFromJsonable

func EmbeddedDataSpecificationFromJsonable(
	jsonable interface{},
) (
	result aastypes.IEmbeddedDataSpecification,
	err error,
)

Parse `jsonable` as an instance of aastypes.IEmbeddedDataSpecification, or return an error.

func EntityFromJsonable

func EntityFromJsonable(
	jsonable interface{},
) (
	result aastypes.IEntity,
	err error,
)

Parse `jsonable` as an instance of aastypes.IEntity, or return an error.

func EntityTypeFromJsonable

func EntityTypeFromJsonable(
	jsonable interface{},
) (result aastypes.EntityType, err error)

Parse `jsonable` as a literal of aastypes.EntityType, or return an error.

func EntityTypeToJsonable

func EntityTypeToJsonable(
	that aastypes.EntityType,
) (result string, err error)

Serialize `that` to a string, or return an error.

func EnvironmentFromJsonable

func EnvironmentFromJsonable(
	jsonable interface{},
) (
	result aastypes.IEnvironment,
	err error,
)

Parse `jsonable` as an instance of aastypes.IEnvironment, or return an error.

func EventElementFromJsonable

func EventElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IEventElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IEventElement, or return an error.

func EventPayloadFromJsonable

func EventPayloadFromJsonable(
	jsonable interface{},
) (
	result aastypes.IEventPayload,
	err error,
)

Parse `jsonable` as an instance of aastypes.IEventPayload, or return an error.

func ExtensionFromJsonable

func ExtensionFromJsonable(
	jsonable interface{},
) (
	result aastypes.IExtension,
	err error,
)

Parse `jsonable` as an instance of aastypes.IExtension, or return an error.

func FileFromJsonable

func FileFromJsonable(
	jsonable interface{},
) (
	result aastypes.IFile,
	err error,
)

Parse `jsonable` as an instance of aastypes.IFile, or return an error.

func HasDataSpecificationFromJsonable

func HasDataSpecificationFromJsonable(
	jsonable interface{},
) (
	result aastypes.IHasDataSpecification,
	err error,
)

Parse `jsonable` as an instance of aastypes.IHasDataSpecification, or return an error.

func HasExtensionsFromJsonable

func HasExtensionsFromJsonable(
	jsonable interface{},
) (
	result aastypes.IHasExtensions,
	err error,
)

Parse `jsonable` as an instance of aastypes.IHasExtensions, or return an error.

func HasKindFromJsonable

func HasKindFromJsonable(
	jsonable interface{},
) (
	result aastypes.IHasKind,
	err error,
)

Parse `jsonable` as an instance of aastypes.IHasKind, or return an error.

func HasSemanticsFromJsonable

func HasSemanticsFromJsonable(
	jsonable interface{},
) (
	result aastypes.IHasSemantics,
	err error,
)

Parse `jsonable` as an instance of aastypes.IHasSemantics, or return an error.

func IdentifiableFromJsonable

func IdentifiableFromJsonable(
	jsonable interface{},
) (
	result aastypes.IIdentifiable,
	err error,
)

Parse `jsonable` as an instance of aastypes.IIdentifiable, or return an error.

func KeyFromJsonable

func KeyFromJsonable(
	jsonable interface{},
) (
	result aastypes.IKey,
	err error,
)

Parse `jsonable` as an instance of aastypes.IKey, or return an error.

func KeyTypesFromJsonable

func KeyTypesFromJsonable(
	jsonable interface{},
) (result aastypes.KeyTypes, err error)

Parse `jsonable` as a literal of aastypes.KeyTypes, or return an error.

func KeyTypesToJsonable

func KeyTypesToJsonable(
	that aastypes.KeyTypes,
) (result string, err error)

Serialize `that` to a string, or return an error.

func LangStringDefinitionTypeIEC61360FromJsonable

func LangStringDefinitionTypeIEC61360FromJsonable(
	jsonable interface{},
) (
	result aastypes.ILangStringDefinitionTypeIEC61360,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILangStringDefinitionTypeIEC61360, or return an error.

func LangStringNameTypeFromJsonable

func LangStringNameTypeFromJsonable(
	jsonable interface{},
) (
	result aastypes.ILangStringNameType,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILangStringNameType, or return an error.

func LangStringPreferredNameTypeIEC61360FromJsonable

func LangStringPreferredNameTypeIEC61360FromJsonable(
	jsonable interface{},
) (
	result aastypes.ILangStringPreferredNameTypeIEC61360,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILangStringPreferredNameTypeIEC61360, or return an error.

func LangStringShortNameTypeIEC61360FromJsonable

func LangStringShortNameTypeIEC61360FromJsonable(
	jsonable interface{},
) (
	result aastypes.ILangStringShortNameTypeIEC61360,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILangStringShortNameTypeIEC61360, or return an error.

func LangStringTextTypeFromJsonable

func LangStringTextTypeFromJsonable(
	jsonable interface{},
) (
	result aastypes.ILangStringTextType,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILangStringTextType, or return an error.

func LevelTypeFromJsonable

func LevelTypeFromJsonable(
	jsonable interface{},
) (
	result aastypes.ILevelType,
	err error,
)

Parse `jsonable` as an instance of aastypes.ILevelType, or return an error.

func ModellingKindFromJsonable

func ModellingKindFromJsonable(
	jsonable interface{},
) (result aastypes.ModellingKind, err error)

Parse `jsonable` as a literal of aastypes.ModellingKind, or return an error.

func ModellingKindToJsonable

func ModellingKindToJsonable(
	that aastypes.ModellingKind,
) (result string, err error)

Serialize `that` to a string, or return an error.

func MultiLanguagePropertyFromJsonable

func MultiLanguagePropertyFromJsonable(
	jsonable interface{},
) (
	result aastypes.IMultiLanguageProperty,
	err error,
)

Parse `jsonable` as an instance of aastypes.IMultiLanguageProperty, or return an error.

func OperationFromJsonable

func OperationFromJsonable(
	jsonable interface{},
) (
	result aastypes.IOperation,
	err error,
)

Parse `jsonable` as an instance of aastypes.IOperation, or return an error.

func OperationVariableFromJsonable

func OperationVariableFromJsonable(
	jsonable interface{},
) (
	result aastypes.IOperationVariable,
	err error,
)

Parse `jsonable` as an instance of aastypes.IOperationVariable, or return an error.

func PropertyFromJsonable

func PropertyFromJsonable(
	jsonable interface{},
) (
	result aastypes.IProperty,
	err error,
)

Parse `jsonable` as an instance of aastypes.IProperty, or return an error.

func QualifiableFromJsonable

func QualifiableFromJsonable(
	jsonable interface{},
) (
	result aastypes.IQualifiable,
	err error,
)

Parse `jsonable` as an instance of aastypes.IQualifiable, or return an error.

func QualifierFromJsonable

func QualifierFromJsonable(
	jsonable interface{},
) (
	result aastypes.IQualifier,
	err error,
)

Parse `jsonable` as an instance of aastypes.IQualifier, or return an error.

func QualifierKindFromJsonable

func QualifierKindFromJsonable(
	jsonable interface{},
) (result aastypes.QualifierKind, err error)

Parse `jsonable` as a literal of aastypes.QualifierKind, or return an error.

func QualifierKindToJsonable

func QualifierKindToJsonable(
	that aastypes.QualifierKind,
) (result string, err error)

Serialize `that` to a string, or return an error.

func RangeFromJsonable

func RangeFromJsonable(
	jsonable interface{},
) (
	result aastypes.IRange,
	err error,
)

Parse `jsonable` as an instance of aastypes.IRange, or return an error.

func ReferableFromJsonable

func ReferableFromJsonable(
	jsonable interface{},
) (
	result aastypes.IReferable,
	err error,
)

Parse `jsonable` as an instance of aastypes.IReferable, or return an error.

func ReferenceElementFromJsonable

func ReferenceElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IReferenceElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IReferenceElement, or return an error.

func ReferenceFromJsonable

func ReferenceFromJsonable(
	jsonable interface{},
) (
	result aastypes.IReference,
	err error,
)

Parse `jsonable` as an instance of aastypes.IReference, or return an error.

func ReferenceTypesFromJsonable

func ReferenceTypesFromJsonable(
	jsonable interface{},
) (result aastypes.ReferenceTypes, err error)

Parse `jsonable` as a literal of aastypes.ReferenceTypes, or return an error.

func ReferenceTypesToJsonable

func ReferenceTypesToJsonable(
	that aastypes.ReferenceTypes,
) (result string, err error)

Serialize `that` to a string, or return an error.

func RelationshipElementFromJsonable

func RelationshipElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.IRelationshipElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.IRelationshipElement, or return an error.

func ResourceFromJsonable

func ResourceFromJsonable(
	jsonable interface{},
) (
	result aastypes.IResource,
	err error,
)

Parse `jsonable` as an instance of aastypes.IResource, or return an error.

func SpecificAssetIDFromJsonable

func SpecificAssetIDFromJsonable(
	jsonable interface{},
) (
	result aastypes.ISpecificAssetID,
	err error,
)

Parse `jsonable` as an instance of aastypes.ISpecificAssetID, or return an error.

func StateOfEventFromJsonable

func StateOfEventFromJsonable(
	jsonable interface{},
) (result aastypes.StateOfEvent, err error)

Parse `jsonable` as a literal of aastypes.StateOfEvent, or return an error.

func StateOfEventToJsonable

func StateOfEventToJsonable(
	that aastypes.StateOfEvent,
) (result string, err error)

Serialize `that` to a string, or return an error.

func SubmodelElementCollectionFromJsonable

func SubmodelElementCollectionFromJsonable(
	jsonable interface{},
) (
	result aastypes.ISubmodelElementCollection,
	err error,
)

Parse `jsonable` as an instance of aastypes.ISubmodelElementCollection, or return an error.

func SubmodelElementFromJsonable

func SubmodelElementFromJsonable(
	jsonable interface{},
) (
	result aastypes.ISubmodelElement,
	err error,
)

Parse `jsonable` as an instance of aastypes.ISubmodelElement, or return an error.

func SubmodelElementListFromJsonable

func SubmodelElementListFromJsonable(
	jsonable interface{},
) (
	result aastypes.ISubmodelElementList,
	err error,
)

Parse `jsonable` as an instance of aastypes.ISubmodelElementList, or return an error.

func SubmodelFromJsonable

func SubmodelFromJsonable(
	jsonable interface{},
) (
	result aastypes.ISubmodel,
	err error,
)

Parse `jsonable` as an instance of aastypes.ISubmodel, or return an error.

func ToJsonable

func ToJsonable(
	that aastypes.IClass,
) (result map[string]interface{}, err error)

Serialize “that“ instance to a JSON-able representation.

Return a structure which can be readily converted to JSON, or an error if some value could not be converted.

func ValueListFromJsonable

func ValueListFromJsonable(
	jsonable interface{},
) (
	result aastypes.IValueList,
	err error,
)

Parse `jsonable` as an instance of aastypes.IValueList, or return an error.

func ValueReferencePairFromJsonable

func ValueReferencePairFromJsonable(
	jsonable interface{},
) (
	result aastypes.IValueReferencePair,
	err error,
)

Parse `jsonable` as an instance of aastypes.IValueReferencePair, or return an error.

Types

type DeserializationError

type DeserializationError struct {
	Path    *aasreporting.Path
	Message string
}

Represent an error during the de-serialization.

Implements `error`.

func (*DeserializationError) Error

func (de *DeserializationError) Error() string

func (*DeserializationError) PathString

func (de *DeserializationError) PathString() string

Render the path as a string.

type SerializationError

type SerializationError struct {
	Path    *aasreporting.Path
	Message string
}

Represent an error during the serialization.

Implements `error`.

func (*SerializationError) Error

func (se *SerializationError) Error() string

func (*SerializationError) PathString

func (se *SerializationError) PathString() string

Render the path as a string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL