public interface IXmlReader extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader and the underlying stream.
|
String |
getAttribute(String localName)
Get the value of the attribute from the current element with the specified local name and no namespace.
|
String |
getAttribute(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
int |
getAttributeCount()
Get the number of attributes in the current element.
|
Iterator |
getAttributeIterator()
Get an iterator for the attributes in the current element.
|
int |
getDepth()
Get the depth of the current element.
|
String |
getEncoding()
Get the encoding of the underlying XML.
|
String |
getLocalName()
Get the local name of the current element.
|
String |
getNamespaceURI()
Get the namespace URI of the current element.
|
String |
getPrefix()
Get the namespace prefix of the current element.
|
String |
getXmlLang()
Get the language of the current element.
|
XmlSpace |
getXmlSpace()
Get the space of the current element.
|
boolean |
isEOF()
Determine whether or not the reader is currently at the end of the stream.
|
boolean |
isStartElement()
Determine whether or not the reader is currently positioned at the start tag of an element.
|
boolean |
isStartElement(String localName)
Determine whether or not the reader is currently positioned at the start tag of an element.
|
boolean |
isStartElement(String localName,
String ns)
Determine whether or not the reader is currently positioned at the start tag of an element.
|
String |
lookupNamespace(String prefix)
Get the current namespace URI for the specified prefix.
|
Optional |
readBoolean(String localName)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
Optional |
readBoolean(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
Optional |
readDouble(String localName)
Get the value of the attribute from the current element with the specified local name.
|
Optional |
readDouble(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
String |
readElementString()
Get the content of the current element.
|
String |
readElementString(String localName)
Get the content of the current element and verify that it has the specified local name.
|
String |
readElementString(String localName,
String ns)
Get the content of the current element and verify that it has the specified local name and namespace URI.
|
void |
readEndElement()
Move the reader past the current element's end tag.
|
Optional |
readFloat(String localName)
Get the value of the attribute from the current element with the specified local name.
|
Optional |
readFloat(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
String |
readInnerXml()
Get all of the elements and attributes within the current element.
|
Optional |
readInt(String localName)
Get the value of the attribute from the current element with the specified local name.
|
Optional |
readInt(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
String |
readOuterXml()
Get the current element, its attributes, and all of the elements and attributes within the current element.
|
Optional |
readShort(String localName)
Get the value of the attribute from the current element with the specified local name.
|
Optional |
readShort(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
void |
readStartElement()
Move past the start tag of the current element.
|
void |
readStartElement(String localName)
Move past the start tag of the current element and verify that the element has the specified local name.
|
void |
readStartElement(String localName,
String ns)
Move past the start tag of the current element and verify that the element has the specified local name and namespace URI.
|
Optional |
readString(String localName)
Get the value of the attribute from the current element with the specified local name.
|
Optional |
readString(String localName,
String namespaceURI)
Get the value of the attribute from the current element with the specified local name and namespace URI.
|
void |
skip()
Skip the current element including all of its children.
|
String getLocalName()
String getNamespaceURI()
String getPrefix()
int getDepth()
XmlSpace getXmlSpace()
String getXmlLang()
int getAttributeCount()
String getAttribute(String localName)
localName - The local name of the attribute to get from the current element.String getAttribute(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readShort(String localName)
localName - The local name of the attribute to get from the current element.Optional readShort(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readInt(String localName)
localName - The local name of the attribute to get from the current element.Optional readInt(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readFloat(String localName)
localName - The local name of the attribute to get from the current element.Optional readFloat(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readDouble(String localName)
localName - The local name of the attribute to get from the current element.Optional readDouble(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readBoolean(String localName)
localName - The local name of the attribute to get from the current element.Optional readBoolean(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Optional readString(String localName)
localName - The local name of the attribute to get from the current element.Optional readString(String localName, String namespaceURI)
localName - The local name of the attribute to get from the current element.namespaceURI - The namespace URI of the attribute to get from the current element.Iterator getAttributeIterator()
boolean isEOF()
void close()
throws XmlReaderException
close in interface AutoCloseableclose in interface CloseableXmlReaderException - If an error has occured in the process of closing the reader.String getEncoding()
void skip() throws XmlReaderException
XmlReaderExceptionvoid readStartElement()
throws XmlReaderException
XmlReaderExceptionvoid readStartElement(String localName) throws XmlReaderException
localName - Verify that this is the local name of the current element.XmlReaderException - if the specified local name of the current element is incorrect.void readStartElement(String localName, String ns) throws XmlReaderException
localName - Verify that this is the local name of the current element.ns - Verify that this is the namespace URI of the current element.XmlReaderException - if the specified local name and namespace URI of the current element are incorrect.String readElementString() throws XmlReaderException
XmlReaderException - if the current element does not contain text (only elements).String readElementString(String localName) throws XmlReaderException
localName - Verify that this is the local name of the current element.XmlReaderException - if the current element does not contain text (only elements) or if the specified local name of the current element are incorrect.String readElementString(String localName, String ns) throws XmlReaderException
localName - Verify that this is the local name of the current element.ns - Verify that this is the namespace URI of the current element.XmlReaderException - if the current element does not contain text (only elements) or if the specified local name and namespace URI of the current element are incorrect.void readEndElement()
throws XmlReaderException
XmlReaderException - if the reader is not currently at an element end tag.boolean isStartElement()
boolean isStartElement(String localName) throws XmlReaderException
localName - Verify that this is the local name of the current element.XmlReaderExceptionboolean isStartElement(String localName, String ns) throws XmlReaderException
localName - Verify that this is the local name of the current element.ns - Verify that this is the namespace URI of the current element.XmlReaderExceptionString readInnerXml() throws XmlReaderException
XmlReaderExceptionString readOuterXml() throws XmlReaderException
XmlReaderExceptionString lookupNamespace(String prefix)
prefix - Get the current namespace URI for this prefix.© 2007, 2022 Precisely. All rights reserved.