Class Attributes
Default implementation of the Attributes interface.
Implements
Inherited Members
Namespace: Sax.Helpers
Assembly: Lucene.Net.Benchmark.dll
Syntax
public class Attributes : IAttributes
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Constructors
Attributes()
Construct a new, empty Attributes object.
Declaration
public Attributes()
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Attributes(IAttributes)
Copy an existing Attributes object.
This constructor is especially useful inside a StartElement(string, string, string, IAttributes).Note, this constructor calls a virtual SetAttributes(IAttributes) to copy the attributes. If you are subclassing this class and don't want SetAttributes to be called, you should use the Attributes() constructor instead and call SetAttributes(IAttributes) or AddAttribute(string, string, string, string, string) yourself if needed.
Declaration
public Attributes(IAttributes atts)
Parameters
Type | Name | Description |
---|---|---|
IAttributes | atts | The existing Attributes object. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Properties
Length
Return the number of attributes in the list.
Declaration
public virtual int Length { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
Methods
AddAttribute(string, string, string, string, string)
Add an attribute to the end of the list.
For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.Declaration
public virtual void AddAttribute(string uri, string localName, string qName, string type, string value)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The Namespace URI, or the empty string if none is available or Namespace processing is not being performed. |
string | localName | The local name, or the empty string if Namespace processing is not being performed. |
string | qName | The qualified (prefixed) name, or the empty string if qualified names are not available. |
string | type | The attribute type as a string. |
string | value | The attribute value. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Clear()
Clear the attribute list for reuse.
Note that little memory is freed by this call: the current array is kept so it can be reused.Declaration
public virtual void Clear()
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
GetIndex(string)
Look up an attribute's index by qualified (prefixed) name.
Declaration
public virtual int GetIndex(string qName)
Parameters
Type | Name | Description |
---|---|---|
string | qName | The qualified name. |
Returns
Type | Description |
---|---|
int | The attribute's index, or -1 if none matches. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetIndex(string, string)
Look up an attribute's index by Namespace name.
Declaration
public virtual int GetIndex(string uri, string localName)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The attribute's Namespace URI, or the empty string if none is available. |
string | localName | The attribute's local name. |
Returns
Type | Description |
---|---|
int | The attribute's index, or -1 if none matches. |
Remarks
In many cases, it will be more efficient to look up the name once and use the index query methods rather than using the name query methods repeatedly.
See Also
GetLocalName(int)
Return an attribute's local name.
Declaration
public virtual string GetLocalName(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The attribute's index (zero-based). |
Returns
Type | Description |
---|---|
string | The attribute's local name, the empty string if none is available, or null if the index if out of range. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetQName(int)
Return an attribute's qualified (prefixed) name.
Declaration
public virtual string GetQName(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The attribute's index (zero-based). |
Returns
Type | Description |
---|---|
string | The attribute's qualified name, the empty string if none is available, or null if the index is out of bounds. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetType(int)
Return an attribute's type by index.
Declaration
public virtual string GetType(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The attribute's index (zero-based). |
Returns
Type | Description |
---|---|
string | The attribute's type, "CDATA" if the type is unknown, or null if the index is out of bounds. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetType(string)
Look up an attribute's type by qualified (prefixed) name.
Declaration
public virtual string GetType(string qName)
Parameters
Type | Name | Description |
---|---|---|
string | qName | The qualified name. |
Returns
Type | Description |
---|---|
string | The attribute's type, or null if there is no matching attribute. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetType(string, string)
Look up an attribute's type by Namespace-qualified name.
Declaration
public virtual string GetType(string uri, string localName)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The Namespace URI, or the empty string for a name with no explicit Namespace URI. |
string | localName | The local name. |
Returns
Type | Description |
---|---|
string | The attribute's type, or null if there is no matching attribute. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetURI(int)
Return an attribute's Namespace URI.
Declaration
public virtual string GetURI(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The attribute's index (zero-based). |
Returns
Type | Description |
---|---|
string | The Namespace URI, the empty string if none is available, or null if the index is out of range. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetValue(int)
Return an attribute's value by index.
Declaration
public virtual string GetValue(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The attribute's index (zero-based). |
Returns
Type | Description |
---|---|
string | The attribute's value or null if the index is out of bounds. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetValue(string)
Look up an attribute's value by qualified (prefixed) name.
Declaration
public virtual string GetValue(string qName)
Parameters
Type | Name | Description |
---|---|---|
string | qName | The qualified name. |
Returns
Type | Description |
---|---|
string | The attribute's value, or null if there is no matching attribute. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
GetValue(string, string)
Look up an attribute's value by Namespace-qualified name.
Declaration
public virtual string GetValue(string uri, string localName)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The Namespace URI, or the empty string for a name with no explicit Namespace URI. |
string | localName | The local name. |
Returns
Type | Description |
---|---|
string | The attribute's value, or null if there is no matching attribute. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
See Also
RemoveAttribute(int)
Remove an attribute from the list.
Declaration
public virtual void RemoveAttribute(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetAttribute(int, string, string, string, string, string)
Set an attribute in the list.
For the sake of speed, this method does no checking for name conflicts or well-formedness: such checks are the responsibility of the application.Declaration
public virtual void SetAttribute(int index, string uri, string localName, string qName, string type, string value)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | uri | The Namespace URI, or the empty string if none is available or Namespace processing is not being performed. |
string | localName | The local name, or the empty string if Namespace processing is not being performed. |
string | qName | The qualified name, or the empty string if qualified names are not available. |
string | type | The attribute type as a string. |
string | value | The attribute value. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetAttributes(IAttributes)
Copy an entire Attributes object.
It may be more efficient to reuse an existing object rather than constantly allocating new ones.Declaration
public virtual void SetAttributes(IAttributes atts)
Parameters
Type | Name | Description |
---|---|---|
IAttributes | atts | The attributes to copy. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
SetLocalName(int, string)
Set the local name of a specific attribute.
Declaration
public virtual void SetLocalName(int index, string localName)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | localName | The attribute's local name, or the empty string for none. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetQName(int, string)
Set the qualified name of a specific attribute.
Declaration
public virtual void SetQName(int index, string qName)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | qName | The attribute's qualified name, or the empty string for none. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetType(int, string)
Set the type of a specific attribute.
Declaration
public virtual void SetType(int index, string type)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | type | The attribute's type. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetURI(int, string)
Set the Namespace URI of a specific attribute.
Declaration
public virtual void SetURI(int index, string uri)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | uri | The attribute's Namespace URI, or the empty string for none. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |
SetValue(int, string)
Set the value of a specific attribute.
Declaration
public virtual void SetValue(int index, string value)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the attribute (zero-based). |
string | value | The attribute's value. |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused. There are two typical uses of this class:- to take a persistent snapshot of an Attributes object in a StartElement(string, string, string, IAttributes) event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | When the supplied index does not point to an attribute in the list. |