Class XmiSerializer
Denotes a serializer implementation that serializes objects to XMI
Inherited Members
Namespace: NMF.Serialization.Xmi
Assembly: NMF.Serialization.dll
Syntax
public class XmiSerializer : XmlSerializer
Constructors
| Edit this page View SourceXmiSerializer()
Creates a new XmiSerializer with default settings and no preloaded types
Declaration
public XmiSerializer()
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. |
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
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 |
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 |
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 SourceXMINamespace
Denotes the XMI namespace
Declaration
public static readonly string XMINamespace
Field Value
Type | Description |
---|---|
string |
XMIPrefix
Denotes the standard prefix for the XMI namespace
Declaration
public static readonly string XMIPrefix
Field Value
Type | Description |
---|---|
string |
XMLSchemaInstanceNamespace
Denotes the namespace for XML schema instance
Declaration
public static readonly string XMLSchemaInstanceNamespace
Field Value
Type | Description |
---|---|
string |
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 SourceIdAttribute
Gets the attribute used for identifiers
Declaration
protected virtual IPropertySerializationInfo IdAttribute { get; }
Property Value
Type | Description |
---|---|
IPropertySerializationInfo |
RootPrefix
Gets or sets the root prefix
Declaration
public string RootPrefix { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceCreateSerializationContext(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
| Edit this page View SourceGetElementTypeInfo(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
| Edit this page View SourceGoToPropertyContent(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
| Edit this page View SourceHandleUnknownAttribute(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
| Edit this page View SourceInitializeElementProperties(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
| Edit this page View SourceInitializeTypeSerializationInfo(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
| Edit this page View SourceOverrideIdentifiedObject(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
| Edit this page View SourceWriteBeginElement(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
| Edit this page View SourceWriteBeginRootElement(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
| Edit this page View SourceWriteElementProperties(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
| Edit this page View SourceWriteEndElement(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
| Edit this page View SourceWriteEndRootElement(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
| Edit this page View SourceWriteIdentifiedObject(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 |