AttributeBank Class

Represents metadata that binds a class and its constructor parameters to XML attributes.

C#
public sealed class AttributeBank
Inheritance
AttributeBank

Remarks

AttributeBank objects are immutable.

Constructors

Properties

Factory

Gets a function that creates an instance of the class bound to this AttributeBank instance, given an array of constructor parameters.

ElementName

Gets the qualified name of the XML element, derived from the ForElementAttribute on the class bound to this metadata.

NameBank

Gets the QNameBank instance used to intern XML qualified names.

ToReflector

Gets a function that maps an attribute name to the Reflector<string> object.

Methods

GetPlaceholder()

Retrieves a placeholder array of objects to be used as constructor parameters.

RecyclePlaceholder(object[])

Recycles a placeholder array of constructor parameters for future reuse.

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

Constructors Detail

AttributeBank(ConstructorInfo, XmlQualifiedName, IEnumerable<AttributeParameter>, QNameBank)

Initializes a new instance of the AttributeBank class.

C#
public AttributeBank(ConstructorInfo ctor, XmlQualifiedName elementName, IEnumerable<AttributeParameter> attributeParameters, QNameBank nameBank)

Parameters

ctor
ConstructorInfo

The constructor of the class annotated with ForElementAttribute.

elementName
XmlQualifiedName

The qualified name of the XML element, derived from the ForElementAttribute on the class bound to this metadata.

attributeParameters
IEnumerable<AttributeParameter>

The collection of AttributeParameter instances, representing constructor parameters attributed with ForAttributeAttribute.

nameBank
QNameBank

The QNameBank instance used to intern XML qualified names.

Properties Detail

Factory

Gets a function that creates an instance of the class bound to this AttributeBank instance, given an array of constructor parameters.

C#
public Func<object[], object> Factory { get; }

Property Value

ElementName

Gets the qualified name of the XML element, derived from the ForElementAttribute on the class bound to this metadata.

C#
public XmlQualifiedName ElementName { get; }

Property Value

NameBank

Gets the QNameBank instance used to intern XML qualified names.

C#
public QNameBank NameBank { get; }

Property Value

ToReflector

Gets a function that maps an attribute name to the Reflector<string> object.

C#
public Func<XmlQualifiedName, Reflector<string>> ToReflector { get; }

Property Value

Methods Detail

GetPlaceholder()

Retrieves a placeholder array of objects to be used as constructor parameters.

C#
public object[] GetPlaceholder()

Returns

object[]

An array of object with a length equal to the number of constructor parameters.

Remarks

If a previously used placeholder is available in the internal queue, it is reused. Otherwise, a new placeholder array is created.

RecyclePlaceholder(object[])

Recycles a placeholder array of constructor parameters for future reuse.

C#
public void RecyclePlaceholder(object[] placeholder)

Parameters

placeholder
object[]

The placeholder array to recycle. Its length must match the number of constructor parameters.