SchemaType Class
A component of Schema that represents one of the child elements, which stands for the class corresponding to the child element, and how the child element occurs inside the parent.
public abstract class SchemaType
- Inheritance
-
Schema
Type
Remarks
The SchemaType object is immutable, and has a class annotated with ForElementAttribute corresponding to the child element. It must be created with one of Mandatory.Of<T>(), Optional.Of<T>() and Multiple.Of<T>().
Constructors
Schema |
Initializes a new instance of the SchemaType class. |
Properties
Element |
Gets the class corresponding to the child element. |
Placeholder |
Gets the placeholder class corresponding to the child element. |
Is |
Gets a value indicating whether the child element always occurs inside the parent. |
Methods
Apply |
Applies the content of the element with the specified action. |
Apply |
Applies the empty element with the specified action. |
Equals(object) | (Inherited from object) |
GetHashCode() | (Inherited from object) |
GetType() | (Inherited from object) |
MemberwiseClone() | (Inherited from object) |
ToString() | (Inherited from object) |
See Also
Constructors Detail
SchemaType(Type, bool, bool)
Initializes a new instance of the SchemaType class.
protected SchemaType(Type type, bool isMandatory, bool isMultiple)
Parameters
- type
- Type
The class corresponding to the child element.
- isMandatory
- bool
Whether the child element always occurs inside the parent.
- isMultiple
- bool
Whether the child element occurs zero or multiple times.
Properties Detail
ElementType
Gets the class corresponding to the child element.
public Type ElementType { get; }
Property Value
The class corresponding to the child element.
PlaceholderType
Gets the placeholder class corresponding to the child element.
public Type PlaceholderType { get; }
Property Value
The placeholder class corresponding to the child element.
IsMandatory
Gets a value indicating whether the child element always occurs inside the parent.
public bool IsMandatory { get; }
Property Value
true
if the child element always occurs inside the parent.
Methods Detail
ApplyWithContent(XmlReader, Func<Type, Metadata>, Reflector<object>, Action<object>)
Applies the content of the element with the specified action.
public abstract void ApplyWithContent(XmlReader input, Func<Type, Metadata> getMetadata, Reflector<object> reflector, Action<object> setChildValue)
Parameters
The function that returns the metadata corresponding to the specified class.
ApplyWithEmptyElement(XmlReader, Func<Type, Metadata>, Reflector<object>, Action<object>)
Applies the empty element with the specified action.
public abstract void ApplyWithEmptyElement(XmlReader input, Func<Type, Metadata> getMetadata, Reflector<object> reflector, Action<object> setChildValue)
Parameters
The function that returns the metadata corresponding to the specified class.