Table of Contents

Class ExplicitIdSerializer

Namespace
NMF.Models.Repository.Serialization
Assembly
NMF.Models.dll

Denotes a serializer that is able to read and understand all model URIs but serializes using XMI IDs

public class ExplicitIdSerializer : ModelSerializer, IModelSerializer
Inheritance
ExplicitIdSerializer
Implements
Inherited Members
Extension Methods

Constructors

ExplicitIdSerializer()

Creates a new instance

public ExplicitIdSerializer()

ExplicitIdSerializer(XmlSerializationSettings)

Creates a new instance

public ExplicitIdSerializer(XmlSerializationSettings settings)

Parameters

settings XmlSerializationSettings

the serializer settings

ExplicitIdSerializer(XmlSerializationSettings, IEnumerable<Type>)

Creates a new instance

public ExplicitIdSerializer(XmlSerializationSettings settings, IEnumerable<Type> knownTypes)

Parameters

settings XmlSerializationSettings

the serializer settings

knownTypes IEnumerable<Type>

a collection of known types

ExplicitIdSerializer(XmlSerializer)

Creates a new instance

public ExplicitIdSerializer(XmlSerializer parent)

Parameters

parent XmlSerializer

the parent serializer

Properties

IdAttribute

Gets the attribute used for identifiers

protected override IPropertySerializationInfo IdAttribute { get; }

Property Value

IPropertySerializationInfo

Methods

GetAttributeValue(object, ITypeSerializationInfo, bool, XmlSerializationContext)

Gets the serialization of the given attribute value

protected override string GetAttributeValue(object value, ITypeSerializationInfo info, bool isCollection, XmlSerializationContext context)

Parameters

value object

The value of the attribute

info ITypeSerializationInfo

The serialization information of the type

isCollection bool

True, if the value is added to a collection, otherwise false

context XmlSerializationContext

The serialization context

Returns

string

The serialized value of the attribute

WriteIdentifiedObject(XmlWriter, object, XmlIdentificationMode, ITypeSerializationInfo, XmlSerializationContext)

Writes the provided identified object

protected override bool WriteIdentifiedObject(XmlWriter writer, object obj, XmlIdentificationMode identificationMode, ITypeSerializationInfo info, XmlSerializationContext context)

Parameters

writer XmlWriter

The xml writer to write to

obj object

The element

identificationMode XmlIdentificationMode

The identification mode for the current object

info ITypeSerializationInfo

The serialization information of the objects type

context XmlSerializationContext

The serialization context

Returns

bool

true, if the object could be written as identified object, otherwise false