Readers Class
Reads and checks XML reader.
public static class Readers
- Inheritance
-
Readers
Methods
Confirm |
Does nothing if there are more parsing events, or throws BindException otherwise. |
Confirm |
Skips the text and checks End Of Stream in the specified XML reader. If the specified XML reader does not reach at the end of the stream, throws BindException. |
Confirm |
Does nothing if the element of the specified local name starts at the specified XML reader, or throws BindException otherwise. |
Confirm |
Does nothing if the element of the specified local name ends at the specified XML reader, or throws BindException otherwise. |
Skip |
Skips the text in the specified XML reader. |
New |
Returns the new BindEvent<T> object of the specified value and the specified location information. |
New |
Returns the new BindEvent<T> object of the specified value and the specified location information. |
To |
Gets the new IXmlLineInfo object associated with the specified XML reader. |
As |
Gets the IXmlLineInfo object associated with the specified XML reader. |
New |
Creates a new BindException representing the lack of the mandatory child element in the empty element. |
New |
Gets a new XmlQualifiedName of the specified XmlReader. |
Equals(Xml |
Gets whether the name that the specifed XML reader represents equals to the specified qualified name. |
Methods Detail
ConfirmNext(XmlReader)
Does nothing if there are more parsing events, or throws BindException otherwise.
public static void ConfirmNext(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
ConfirmEndOfStream(XmlReader)
Skips the text and checks End Of Stream in the specified XML reader. If the specified XML reader does not reach at the end of the stream, throws BindException.
public static void ConfirmEndOfStream(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
ConfirmStartElement(XmlReader, XmlQualifiedName)
Does nothing if the element of the specified local name starts at the specified XML reader, or throws BindException otherwise.
public static void ConfirmStartElement(XmlReader @in, XmlQualifiedName expectedName)
Parameters
- in
-
Xml
Reader
The XML reader.
- expectedName
-
Xml
Qualified Name
The local name that is expected.
ConfirmEndElement(XmlReader, XmlQualifiedName)
Does nothing if the element of the specified local name ends at the specified XML reader, or throws BindException otherwise.
public static void ConfirmEndElement(XmlReader @in, XmlQualifiedName expectedName)
Parameters
- in
-
Xml
Reader
The XML reader.
- expectedName
-
Xml
Qualified Name
The local name that is expected.
SkipCharacters(XmlReader)
Skips the text in the specified XML reader.
public static XmlNodeType SkipCharacters(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
Returns
The current node type other than the text.
NewEvent<T>(IXmlLineInfo, T)
Returns the new BindEvent<T> object of the specified value and the specified location information.
public static BindEvent<T> NewEvent<T>(IXmlLineInfo info, T value)
Type Parameters
- T
-
class
The type of the event value.
Parameters
- info
-
IXml
Line Info
The location information.
- value
- T
The value of the event.
Returns
The new bind event.
NewEventObject(IXmlLineInfo, object)
Returns the new BindEvent<T> object of the specified value and the specified location information.
public static object NewEventObject(IXmlLineInfo info, object value)
Parameters
- info
-
IXml
Line Info
The location information.
- value
- object
The value of the event.
Returns
The new bind event.
ToXmlLineInfo(XmlReader)
Gets the new IXmlLineInfo object associated with the specified XML reader.
public static IXmlLineInfo ToXmlLineInfo(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
Returns
The IXmlLineInfo object which is immutable.
AsXmlLineInfo(XmlReader)
Gets the IXmlLineInfo object associated with the specified XML reader.
public static IXmlLineInfo AsXmlLineInfo(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
Returns
The IXmlLineInfo object that the XML reader object is casted to, or the default IXmlLineInfo object if it is failed to cast.
NewBindExceptionDueToEmptyElement(XmlReader, XmlQualifiedName)
Creates a new BindException representing the lack of the mandatory child element in the empty element.
public static BindException NewBindExceptionDueToEmptyElement(XmlReader @in, XmlQualifiedName expectedChildElementName)
Parameters
- in
-
Xml
Reader
The XML reader.
- expectedChildElementName
-
Xml
Qualified Name
The name of the element that is expected as the child element.
Returns
The new BindException.
NewQName(XmlReader)
Gets a new XmlQualifiedName of the specified XmlReader.
public static XmlQualifiedName NewQName(XmlReader @in)
Parameters
- in
-
Xml
Reader
The XML reader.
Returns
The new qualified name that the specified XML reader represents.
Equals(XmlReader, XmlQualifiedName)
Gets whether the name that the specifed XML reader represents equals to the specified qualified name.
public static bool Equals(XmlReader @in, XmlQualifiedName qName)
Parameters
- in
-
Xml
Reader
The XML reader.
- qName
-
Xml
Qualified Name
The qualified name.
Returns
true
if the name that the XML reader represents equals
to the qualified name, false
otherwise.