Metadata Class
Metadata binding a class and its members to the XML element and attributes.
public abstract class Metadata
- Inheritance
-
Metadata
- Derived
Remarks
Metadata
objects are immutable.
Constructors
Metadata(Type) |
Initializes a new instance of the Metadata class. |
Properties
Element |
Gets the class representing the XML element, annotated with ForElementAttribute for the class bound to this metadata. |
Element |
Gets the name of the XML element, which is the value of the annotation ForElementAttribute for the class bound to this metadata. |
Methods
Mandatory |
Returns a new instance bound to the root XML element that is read from the specified XML reader. |
Create |
Creates a new instance bound to the next XML element in the specified XML reader. |
Handle |
Handles the component of the specified instance with content of the element that the specified XML reader provides. |
Handle |
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.
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.
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.
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.
public object MandatoryElement(XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- in
-
Xml
Reader
The XML reader.
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.
public object CreateInstance(XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- in
-
Xml
Reader
The XML reader.
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.
protected abstract void HandleComponentsWithContent(object instance, XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- instance
- object
The instance whose components are handled.
- in
-
Xml
Reader
The XML reader.
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.
protected abstract void HandleComponentsWithEmptyElement(object instance, XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- instance
- object
The instance whose components are handled.
- in
-
Xml
Reader
The XML reader.