Show / Hide Table of Contents

Class XmiSerializer

Denotes a serializer implementation that serializes objects to XMI

Inheritance
object
XmlSerializer
XmiSerializer
ModelSerializer
Inherited Members
XmlSerializer.Settings
XmlSerializer.KnownTypes
XmlSerializer.RegisterNamespace(ITypeSerializationInfo)
XmlSerializer.GetTypeInfo(string, string)
XmlSerializer.CreateTypeSerializationInfoFor(Type)
XmlSerializer.Serialize(object, string, bool)
XmlSerializer.Serialize(object, Stream, bool)
XmlSerializer.Serialize(object, TextWriter)
XmlSerializer.Serialize(object, XmlWriter)
XmlSerializer.Serialize(object, TextWriter, bool)
XmlSerializer.Serialize(object, XmlWriter, bool)
XmlSerializer.Serialize(object, XmlWriter, IPropertySerializationInfo, bool, XmlIdentificationMode, XmlSerializationContext)
XmlSerializer.SelectRoot(object, bool)
XmlSerializer.WriteConstructorProperties(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.WriteAttributeProperties(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.WriteAttributeValue(XmlWriter, object, object, IPropertySerializationInfo, XmlSerializationContext)
XmlSerializer.GetAttributeValue(object, ITypeSerializationInfo, bool, XmlSerializationContext)
XmlSerializer.WriteCollectionMembers(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.Deserialize(string)
XmlSerializer.Deserialize(Stream)
XmlSerializer.Deserialize(TextReader)
XmlSerializer.Deserialize(XmlReader)
XmlSerializer.CreateRoot(XmlReader)
XmlSerializer.GetRootElementTypeInfo(XmlReader)
XmlSerializer.CreateObject(XmlReader, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.InitializeProperty(XmlReader, IPropertySerializationInfo, object, XmlSerializationContext)
XmlSerializer.InitializePropertyFromText(IPropertySerializationInfo, object, string, XmlSerializationContext)
XmlSerializer.Initialize(XmlReader, object, XmlSerializationContext)
XmlSerializer.IsPropertyElement(XmlReader, IPropertySerializationInfo)
XmlSerializer.InitializeAttributeProperties(XmlReader, object, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.HandleUnknownType(IPropertySerializationInfo, string, string)
XmlSerializer.HandleUnknownElement(XmlReader, object, ITypeSerializationInfo, XmlSerializationContext)
XmlSerializer.OnUnknownElement(UnknownElementEventArgs)
XmlSerializer.OnUnknownAttribute(UnknownAttributeEventArgs)
XmlSerializer.OnUnknownType(UnknownTypeEventArgs)
XmlSerializer.UnknownElement
XmlSerializer.UnknownAttribute
XmlSerializer.UnknownType
XmlSerializer.GetSerializationInfoForInstance(object, bool)
XmlSerializer.GetSerializationInfo(Type, bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Serialization.Xmi
Assembly: NMF.Serialization.dll
Syntax
public class XmiSerializer : XmlSerializer

Constructors

| Edit this page View Source

XmiSerializer()

Creates a new XmiSerializer with default settings and no preloaded types

Declaration
public XmiSerializer()
| Edit this page View Source

XmiSerializer(XmlSerializationSettings)

Creates a new XmiSerializer with the specified settings

Declaration
public XmiSerializer(XmlSerializationSettings settings)
Parameters
Type Name Description
XmlSerializationSettings settings

Serializer-settings for the serializer. Can be null or Nothing in Visual Basic. In this case, the default settings will be used.

| Edit this page View Source

XmiSerializer(XmlSerializationSettings, IEnumerable<Type>)

Creates a new XmiSerializer with the specified settings and the given preloaded types

Declaration
public XmiSerializer(XmlSerializationSettings settings, IEnumerable<Type> additionalTypes)
Parameters
Type Name Description
XmlSerializationSettings settings

The settings to use for the serializer

IEnumerable<Type> additionalTypes

Set of types to load into the serializer

Remarks

The types will be loaded with the specified settings

| Edit this page View Source

XmiSerializer(XmlSerializer)

Creates a new XmlSerializer and copies settings and known types from the given serializer

Declaration
public XmiSerializer(XmlSerializer parent)
Parameters
Type Name Description
XmlSerializer parent

An XML serializer to copy settings and known type information from

| Edit this page View Source

XmiSerializer(XmlSerializer, XmlSerializationSettings)

Creates a new XmlSerializer and copies settings and known types from the given serializer

Declaration
public XmiSerializer(XmlSerializer parent, XmlSerializationSettings settings)
Parameters
Type Name Description
XmlSerializer parent

An XML serializer to copy settings and known type information from

XmlSerializationSettings settings

New settings

| Edit this page View Source

XmiSerializer(IEnumerable<Type>)

Creates a new XmiSerializer with default settings

Declaration
public XmiSerializer(IEnumerable<Type> additionalTypes)
Parameters
Type Name Description
IEnumerable<Type> additionalTypes

Set of types to preload into the serializer

Remarks

Types will be loaded with default settings

Fields

| Edit this page View Source

XMINamespace

Denotes the XMI namespace

Declaration
public static readonly string XMINamespace
Field Value
Type Description
string
| Edit this page View Source

XMIPrefix

Denotes the standard prefix for the XMI namespace

Declaration
public static readonly string XMIPrefix
Field Value
Type Description
string
| Edit this page View Source

XMLSchemaInstanceNamespace

Denotes the namespace for XML schema instance

Declaration
public static readonly string XMLSchemaInstanceNamespace
Field Value
Type Description
string
| Edit this page View Source

XMLSchemaInstancePrefix

Denotes the standard prefix to use for the XML schema instance namespace

Declaration
public static readonly string XMLSchemaInstancePrefix
Field Value
Type Description
string

Properties

| Edit this page View Source

IdAttribute

Gets the attribute used for identifiers

Declaration
protected virtual IPropertySerializationInfo IdAttribute { get; }
Property Value
Type Description
IPropertySerializationInfo
| Edit this page View Source

RootPrefix

Gets or sets the root prefix

Declaration
public string RootPrefix { get; set; }
Property Value
Type Description
string

Methods

| Edit this page View Source

CreateSerializationContext(object)

Creates a serialization context for the given root element

Declaration
protected override XmlSerializationContext CreateSerializationContext(object root)
Parameters
Type Name Description
object root

The root element of the serialization

Returns
Type Description
XmlSerializationContext

A serialization context

Overrides
XmlSerializer.CreateSerializationContext(object)
| Edit this page View Source

GetElementTypeInfo(XmlReader, IPropertySerializationInfo)

Gets the type information for the current property

Declaration
protected override ITypeSerializationInfo GetElementTypeInfo(XmlReader reader, IPropertySerializationInfo property)
Parameters
Type Name Description
XmlReader reader

The xml reader

IPropertySerializationInfo property

The current property

Returns
Type Description
ITypeSerializationInfo

The type serialization info that should be used in the remainder

Overrides
XmlSerializer.GetElementTypeInfo(XmlReader, IPropertySerializationInfo)
| Edit this page View Source

GoToPropertyContent(XmlReader)

Moves the reader to the content of the property

Declaration
protected override bool GoToPropertyContent(XmlReader reader)
Parameters
Type Name Description
XmlReader reader

the Xml reader

Returns
Type Description
bool

true, if the reader could be moved sucessfully, otherwise false

Overrides
XmlSerializer.GoToPropertyContent(XmlReader)
| Edit this page View Source

HandleUnknownAttribute(XmlReader, object, ITypeSerializationInfo, XmlSerializationContext)

Handles an attribute that was not known to the serializer

Declaration
protected override void HandleUnknownAttribute(XmlReader reader, object obj, ITypeSerializationInfo info, XmlSerializationContext context)
Parameters
Type Name Description
XmlReader reader

The current reader position

object obj

The object that is currently deserialized

ITypeSerializationInfo info

The type serialization information of the object

XmlSerializationContext context

The serialization context

Overrides
XmlSerializer.HandleUnknownAttribute(XmlReader, object, ITypeSerializationInfo, XmlSerializationContext)
| Edit this page View Source

InitializeElementProperties(XmlReader, ref object, ITypeSerializationInfo, XmlSerializationContext)

Initializes the element properties from the xml reader position

Declaration
protected override void InitializeElementProperties(XmlReader reader, ref object obj, ITypeSerializationInfo info, XmlSerializationContext context)
Parameters
Type Name Description
XmlReader reader

the xml reader

object obj

the element

ITypeSerializationInfo info

the type serialization information

XmlSerializationContext context

the serialization context

Overrides
XmlSerializer.InitializeElementProperties(XmlReader, ref object, ITypeSerializationInfo, XmlSerializationContext)
| Edit this page View Source

InitializeTypeSerializationInfo(Type, ITypeSerializationInfo)

Initializes the given type serialization information for the given type

Declaration
protected override void InitializeTypeSerializationInfo(Type type, ITypeSerializationInfo serializationInfo)
Parameters
Type Name Description
Type type

the system type

ITypeSerializationInfo serializationInfo

the serialization information object

Overrides
XmlSerializer.InitializeTypeSerializationInfo(Type, ITypeSerializationInfo)
| Edit this page View Source

OverrideIdentifiedObject(object, XmlReader, XmlSerializationContext)

Determines whether the already identified element should be overridden

Declaration
protected override bool OverrideIdentifiedObject(object obj, XmlReader reader, XmlSerializationContext context)
Parameters
Type Name Description
object obj

The object that would be overridden

XmlReader reader

The current reader position

XmlSerializationContext context

The serialization context

Returns
Type Description
bool

true, if the element shall be overridden, otherwise false

Overrides
XmlSerializer.OverrideIdentifiedObject(object, XmlReader, XmlSerializationContext)
| Edit this page View Source

WriteBeginElement(XmlWriter, object, ITypeSerializationInfo)

Writes the beginning of an element

Declaration
protected override void WriteBeginElement(XmlWriter writer, object obj, ITypeSerializationInfo info)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object obj

The element

ITypeSerializationInfo info

The serialization information of the objects type

Overrides
XmlSerializer.WriteBeginElement(XmlWriter, object, ITypeSerializationInfo)
| Edit this page View Source

WriteBeginRootElement(XmlWriter, object, ITypeSerializationInfo)

Writes the root element to the given writer

Declaration
protected override void WriteBeginRootElement(XmlWriter writer, object root, ITypeSerializationInfo info)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object root

The root element

ITypeSerializationInfo info

The serialization information of the objects type

Overrides
XmlSerializer.WriteBeginRootElement(XmlWriter, object, ITypeSerializationInfo)
| Edit this page View Source

WriteElementProperties(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)

Writes the element properties of the given object to the provided writer

Declaration
protected override void WriteElementProperties(XmlWriter writer, object obj, ITypeSerializationInfo info, XmlSerializationContext context)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object obj

The element

ITypeSerializationInfo info

The serialization information of the objects type

XmlSerializationContext context

The serialization context

Overrides
XmlSerializer.WriteElementProperties(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)
| Edit this page View Source

WriteEndElement(XmlWriter, object, ITypeSerializationInfo)

Completes the current element for the provided object

Declaration
protected override void WriteEndElement(XmlWriter writer, object obj, ITypeSerializationInfo info)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object obj

The element

ITypeSerializationInfo info

The serialization information of the objects type

Overrides
XmlSerializer.WriteEndElement(XmlWriter, object, ITypeSerializationInfo)
| Edit this page View Source

WriteEndRootElement(XmlWriter, object, ITypeSerializationInfo)

Completes the root element

Declaration
protected override void WriteEndRootElement(XmlWriter writer, object root, ITypeSerializationInfo info)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object root

The element

ITypeSerializationInfo info

The serialization information of the objects type

Overrides
XmlSerializer.WriteEndRootElement(XmlWriter, object, ITypeSerializationInfo)
| Edit this page View Source

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

Writes the provided identified object

Declaration
protected override bool WriteIdentifiedObject(XmlWriter writer, object obj, XmlIdentificationMode identificationMode, ITypeSerializationInfo info, XmlSerializationContext context)
Parameters
Type Name Description
XmlWriter writer

The xml writer to write to

object obj

The element

XmlIdentificationMode identificationMode

The identification mode for the current object

ITypeSerializationInfo info

The serialization information of the objects type

XmlSerializationContext context

The serialization context

Returns
Type Description
bool

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

Overrides
XmlSerializer.WriteIdentifiedObject(XmlWriter, object, XmlIdentificationMode, ITypeSerializationInfo, XmlSerializationContext)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX