AttributeBank Class
Represents metadata that binds a class and its constructor parameters to XML attributes.
public sealed class AttributeBank
- Inheritance
-
Attribute
Bank
Remarks
AttributeBank
objects are immutable.
Constructors
Attribute |
Initializes a new instance of the AttributeBank class. |
Properties
Factory |
Gets a function that creates an instance of the class bound to this AttributeBank instance, given an array of constructor parameters. |
Element |
Gets the qualified name of the XML element, derived from the ForElementAttribute on the class bound to this metadata. |
Name |
Gets the QNameBank instance used to intern XML qualified names. |
To |
Gets a function that maps an attribute name to the Reflector<string> object. |
Methods
Get |
Retrieves a placeholder array of objects to be used as constructor parameters. |
Recycle |
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.
public AttributeBank(ConstructorInfo ctor, XmlQualifiedName elementName, IEnumerable<AttributeParameter> attributeParameters, QNameBank nameBank)
Parameters
- ctor
-
Constructor
Info
The constructor of the class annotated with ForElementAttribute.
- elementName
-
Xml
Qualified Name
The qualified name of the XML element, derived from the ForElementAttribute on the class bound to this metadata.
- attributeParameters
-
IEnumerable<Attribute
Parameter >
The collection of AttributeParameter instances, representing constructor parameters attributed with ForAttributeAttribute.
Properties Detail
Factory
Gets a function that creates an instance of the class bound to this AttributeBank instance, given an array of constructor parameters.
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.
public XmlQualifiedName ElementName { get; }
Property Value
NameBank
Gets the QNameBank instance used to intern XML qualified names.
public QNameBank NameBank { get; }
Property Value
ToReflector
Gets a function that maps an attribute name to the Reflector<string> object.
public Func<XmlQualifiedName, Reflector<string>> ToReflector { get; }
Property Value
Methods Detail
GetPlaceholder()
Retrieves a placeholder array of objects to be used as constructor parameters.
public object[] GetPlaceholder()
Returns
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.
public void RecyclePlaceholder(object[] placeholder)
Parameters
- placeholder
- object[]
The placeholder array to recycle. Its length must match the number of constructor parameters.