Skip to main content

Definition

Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization

Syntax

Summary

Provides serialization metadata about an object type with constructors, properties, and fields. This class cannot be inherited.

Remarks

Source-generated contexts create instances of this class and pass them to XmlMetadataServices.CreateObjectInfo. It is analogous to JsonObjectInfoValues<T> in System.Text.Json. The serializer reads and writes the type from this metadata with the rules it applies to a type it maps through reflection, and with no reflection over the members of the type.

Type Parameters

  • T - The object type to serialize or deserialize.

Constructors

.ctor

Syntax

.ctor Inherited

Inherited from object

Syntax

Properties

ConstructorParameterMetadataInitializer

Gets or initializes a method that returns the metadata of the parameters of the constructor that XmlObjectInfoValues`1.ObjectWithParameterizedConstructorCreator calls.

Syntax

Property Value

Type: System.Func<CloudNimble.Text.Xml.Serialization.XmlParameterInfoValues[]>? A method that returns one XmlParameterInfoValues for each parameter, or null when the type is not created through a constructor with parameters.

ObjectCreator

Gets or initializes a mechanism to create an instance of the type with no arguments.

Syntax

Property Value

Type: System.Func<T>? A method that creates the object, or null when the type is created through XmlObjectInfoValues`1.ObjectWithParameterizedConstructorCreator or is never created, as an abstract class is not.

ObjectWithParameterizedConstructorCreator

Gets or initializes a mechanism to create an instance of the type through a constructor with parameters.

Syntax

Property Value

Type: System.Func<object?[], T>? A method that creates the object from an array that holds one argument for each parameter, in the order of XmlParameterInfoValues.Position; or null. The array may be longer than the parameter list.

PropertyMetadataInitializer

Gets or initializes a method that returns the metadata of the properties and fields of the type.

Syntax

Property Value

Type: System.Func<CloudNimble.Text.Xml.XmlSerializerOptions, CloudNimble.Text.Xml.Serialization.XmlPropertyInfoValues[]>? A method that returns one XmlPropertyInfoValues for each property and field of the type and its base types, in the order they are declared, base types first. The serializer leaves out the ones the options and the attributes exclude; or null when the type has no metadata, as in XmlSourceGenerationMode.Serialization.

SerializeHandler

Gets or initializes a method that writes the members of an object directly, without the metadata.

Syntax

Property Value

Type: System.Action<CloudNimble.Text.Xml.Utf8XmlWriter, T, CloudNimble.Text.Xml.XmlSerializerOptions>? A method that writes the attributes and the content of the element for a value, or null. The start and end tags are written by the serializer.

Remarks

A source-generated context sets this only when XmlMetadataServices.CanUseSerializeHandler says the options allow it. When it is set, the serializer writes through it. When XmlObjectInfoValues1.PropertyMetadataInitializer](/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlObjectInfoValues#propertymetadatainitializer) is [null` as well, the type has no metadata: it can be written through this method and cannot be read.

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?