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
XmlSerializationSettingsthe serializer settings
ExplicitIdSerializer(XmlSerializationSettings, IEnumerable<Type>)
Creates a new instance
public ExplicitIdSerializer(XmlSerializationSettings settings, IEnumerable<Type> knownTypes)
Parameters
settings
XmlSerializationSettingsthe serializer settings
knownTypes
IEnumerable<Type>a collection of known types
ExplicitIdSerializer(XmlSerializer)
Creates a new instance
public ExplicitIdSerializer(XmlSerializer parent)
Parameters
parent
XmlSerializerthe parent serializer
Properties
IdAttribute
Gets the attribute used for identifiers
protected override IPropertySerializationInfo IdAttribute { get; }
Property Value
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
objectThe value of the attribute
info
ITypeSerializationInfoThe serialization information of the type
isCollection
boolTrue, if the value is added to a collection, otherwise false
context
XmlSerializationContextThe 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
XmlWriterThe xml writer to write to
obj
objectThe element
identificationMode
XmlIdentificationModeThe identification mode for the current object
info
ITypeSerializationInfoThe serialization information of the objects type
context
XmlSerializationContextThe serialization context
Returns
- bool
true, if the object could be written as identified object, otherwise false