Metadata Class

Metadata binding a class and its members to the XML element and attributes.

C#
public abstract class Metadata
Inheritance
Metadata
Derived

Remarks

Metadata objects are immutable.

Constructors

Metadata(Type)

Initializes a new instance of the Metadata class.

Properties

ElementClass

Gets the class representing the XML element, annotated with ForElementAttribute for the class bound to this metadata.

ElementName

Gets the name of the XML element, which is the value of the annotation ForElementAttribute for the class bound to this metadata.

Methods

MandatoryElement(XmlReader, Func<Type, Metadata>)

Returns a new instance bound to the root XML element that is read from the specified XML reader.

CreateInstance(XmlReader, Func<Type, Metadata>)

Creates a new instance bound to the next XML element in the specified XML reader.

HandleComponentsWithContent(object, XmlReader, Func<Type, Metadata>)

Handles the component of the specified instance with content of the element that the specified XML reader provides.

HandleComponentsWithEmptyElement(object, XmlReader, Func<Type, Metadata>)

Handles the component of the specified instance with empty element that the specified XML reader is providing.

Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)

Constructors Detail

Metadata(Type)

Initializes a new instance of the Metadata class.

C#
protected Metadata(Type elementClass)

Parameters

elementClass
Type

The class annotated with ForElementAttribute.

Properties Detail

ElementClass

Gets the class representing the XML element, annotated with ForElementAttribute for the class bound to this metadata.

C#
public Type ElementClass { get; }

Property Value

ElementName

Gets the name of the XML element, which is the value of the annotation ForElementAttribute for the class bound to this metadata.

C#
public XmlQualifiedName ElementName { get; }

Property Value

Methods Detail

MandatoryElement(XmlReader, Func<Type, Metadata>)

Returns a new instance bound to the root XML element that is read from the specified XML reader.

C#
public object MandatoryElement(XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

in
XmlReader

The XML reader.

getMetadata
Func<Type, Metadata>

The function that returns the Metadata object associated with its argument of the specified class.

Returns

A new instance bound to the root XML element.

CreateInstance(XmlReader, Func<Type, Metadata>)

Creates a new instance bound to the next XML element in the specified XML reader.

C#
public object CreateInstance(XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

in
XmlReader

The XML reader.

getMetadata
Func<Type, Metadata>

The function that returns the Metadata object associated with its argument of the specified class.

Returns

A new instance bound to the next XML element in the specified XML reader.

HandleComponentsWithContent(object, XmlReader, Func<Type, Metadata>)

Handles the component of the specified instance with content of the element that the specified XML reader provides.

C#
protected abstract void HandleComponentsWithContent(object instance, XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

instance
object

The instance whose components are handled.

in
XmlReader

The XML reader.

getMetadata
Func<Type, Metadata>

The function that returns the Metadata object associated with its argument of the specified class.

HandleComponentsWithEmptyElement(object, XmlReader, Func<Type, Metadata>)

Handles the component of the specified instance with empty element that the specified XML reader is providing.

C#
protected abstract void HandleComponentsWithEmptyElement(object instance, XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

instance
object

The instance whose components are handled.

in
XmlReader

The XML reader.

getMetadata
Func<Type, Metadata>

The function that returns the Metadata object associated with its argument of the specified class.