azure-docs-sdk-java/docs-ref-autogen/com.azure.xml.XmlReader.yml

470 строки
42 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

### YamlMime:JavaType
uid: "com.azure.xml.XmlReader"
fullName: "com.azure.xml.XmlReader"
name: "XmlReader"
nameWithType: "XmlReader"
summary: "Reads an XML encoded value as a stream of tokens."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **XmlReader**</br> implements <a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
methods:
- uid: "com.azure.xml.XmlReader.<T>getNullableAttribute(java.lang.String,java.lang.String,com.azure.xml.XmlReadValueCallback<java.lang.String,T>)"
fullName: "com.azure.xml.XmlReader.getNullableAttribute(String namespaceUri, String localName, XmlReadValueCallback<String,T> converter)"
name: "getNullableAttribute(String namespaceUri, String localName, XmlReadValueCallback<String,T> converter)"
nameWithType: "XmlReader.getNullableAttribute(String namespaceUri, String localName, XmlReadValueCallback<String,T> converter)"
summary: "Gets the nullable value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Function that converts the attribute text value to the nullable type."
name: "converter"
type: "<xref href=\"com.azure.xml.XmlReadValueCallback?alt=com.azure.xml.XmlReadValueCallback&text=XmlReadValueCallback\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public T <T>getNullableAttribute(String namespaceUri, String localName, XmlReadValueCallback<String,T> converter)"
exceptions:
- description: "If the nullable attribute cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the nullable value for the attribute in the XML element.\n\nIf the attribute doesn't have a value or doesn't exist null will be returned, otherwise the attribute <xref uid=\"com.azure.xml.XmlReader.getStringAttribute(java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getStringAttribute(String, String)\"></xref> is passed to the converter.\n\n**Code Samples**\n\n```java\ntry (XmlReader reader = XmlReader.fromString(\"<root><element attribute=\\\"1234\\\"/></root>\")) {\n reader.nextElement(); // Progress to <root>\n reader.nextElement(); // Progress to <element>\n\n // Get the value of the attribute \"attribute\" as an Integer in a way that allows for the attribute to be\n // missing or have a null value.\n Objects.equals(1234, reader.getNullableAttribute(null, \"attribute\", Integer::parseInt));\n\n // This attribute doesn't exist, so null is returned without causing a NumberFormatException (which is what\n // Integer.parseInt throws on a null string being passed).\n Objects.isNull(reader.getNullableAttribute(null, \"nonExistentAttribute\", Integer::parseInt));\n } catch (XMLStreamException ex) {\n // Do something with the exception\n }\n```"
returns:
description: "The converted text value, or null if the attribute didn't have a value."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.<T>getNullableElement(com.azure.xml.XmlReadValueCallback<java.lang.String,T>)"
fullName: "com.azure.xml.XmlReader.getNullableElement(XmlReadValueCallback<String,T> converter)"
name: "getNullableElement(XmlReadValueCallback<String,T> converter)"
nameWithType: "XmlReader.getNullableElement(XmlReadValueCallback<String,T> converter)"
summary: "Gets the nullable value for the current element."
parameters:
- description: "Function that converts the element text value to the nullable type."
name: "converter"
type: "<xref href=\"com.azure.xml.XmlReadValueCallback?alt=com.azure.xml.XmlReadValueCallback&text=XmlReadValueCallback\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public T <T>getNullableElement(XmlReadValueCallback<String,T> converter)"
exceptions:
- description: "If the nullable element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the nullable value for the current element.\n\nIf the current element doesn't have a value null will be returned, otherwise the element <xref uid=\"com.azure.xml.XmlReader.getStringElement()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"text value\"></xref> is passed to the converter.\n\n**Code Samples**\n\n```java\ntry (XmlReader reader = XmlReader.fromString(\"<root><element>1234</element><emptyElement/></root>\")) {\n reader.nextElement(); // Progress to <root>\n reader.nextElement(); // Progress to <element>\n\n // Get the value of the element \"element\" as an Integer in a way that allows for the element to be missing\n // or have a null value.\n Objects.equals(1234, reader.getNullableElement(Integer::parseInt)); // 1234\n\n reader.nextElement(); // Progress to <emptyElement>\n\n // This element doesn't exist, so null is returned without causing a NumberFormatException (which is what\n // Integer.parseInt throws on a null string being passed).\n Objects.isNull(reader.getNullableElement(Integer::parseInt));\n } catch (XMLStreamException ex) {\n // Do something with the exception\n }\n```"
returns:
description: "The converted text value, or null if the element didn't have a value."
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.<T>readObject(java.lang.String,com.azure.xml.XmlReadValueCallback<com.azure.xml.XmlReader,T>)"
fullName: "com.azure.xml.XmlReader.readObject(String localName, XmlReadValueCallback<XmlReader,T> converter)"
name: "readObject(String localName, XmlReadValueCallback<XmlReader,T> converter)"
nameWithType: "XmlReader.readObject(String localName, XmlReadValueCallback<XmlReader,T> converter)"
summary: "Reads an object from the XML stream."
parameters:
- description: "The expecting starting local name for the object."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The function that reads the object."
name: "converter"
type: "<xref href=\"com.azure.xml.XmlReadValueCallback?alt=com.azure.xml.XmlReadValueCallback&text=XmlReadValueCallback\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />,<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public T <T>readObject(String localName, XmlReadValueCallback<XmlReader,T> converter)"
exceptions:
- description: "If the starting tag isn't <xref uid=\"XmlToken#START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> or the tag doesn't match\n the expected <code>startTagName</code>"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Reads an object from the XML stream.\n\nValidates that the <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> is currently pointing to an <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> which has the qualifying name specified by the `startTagName`.\n\n**Code Samples**\n\n```java\nreturn xmlReader.readObject(getRootElementName(rootElementName, \"Name\"), reader -> {\n BlobName result = new BlobName();\n result.encoded = reader.getNullableAttribute(null, \"Encoded\", Boolean::parseBoolean);\n result.content = reader.getStringElement();\n\n return result;\n });\n```"
returns:
description: "An instance of the expected object,"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.<T>readObject(java.lang.String,java.lang.String,com.azure.xml.XmlReadValueCallback<com.azure.xml.XmlReader,T>)"
fullName: "com.azure.xml.XmlReader.readObject(String namespaceUri, String localName, XmlReadValueCallback<XmlReader,T> converter)"
name: "readObject(String namespaceUri, String localName, XmlReadValueCallback<XmlReader,T> converter)"
nameWithType: "XmlReader.readObject(String namespaceUri, String localName, XmlReadValueCallback<XmlReader,T> converter)"
summary: "Reads an object from the XML stream."
parameters:
- description: "The expecting namespace for the object."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The expecting starting local name for the object."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The function that reads the object."
name: "converter"
type: "<xref href=\"com.azure.xml.XmlReadValueCallback?alt=com.azure.xml.XmlReadValueCallback&text=XmlReadValueCallback\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />,<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public T <T>readObject(String namespaceUri, String localName, XmlReadValueCallback<XmlReader,T> converter)"
exceptions:
- description: "If the starting tag isn't <xref uid=\"XmlToken#START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> or the tag doesn't match\n the expected <code>startTagName</code>"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Reads an object from the XML stream.\n\nValidates that the <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> is currently pointing to an <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> which has the qualifying name specified by the `startTagName`.\n\n**Code Samples**\n\n```java\nreturn xmlReader.readObject(\"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n getRootElementName(rootElementName, \"NamespaceInfo\"), reader -> {\n NamespaceProperties properties = new NamespaceProperties();\n\n while (xmlReader.nextElement() != XmlToken.END_ELEMENT) {\n QName qName = xmlReader.getElementName();\n String localPart = qName.getLocalPart();\n String namespaceUri = qName.getNamespaceURI();\n\n if (\"Alias\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.alias = xmlReader.getStringElement();\n } else if (\"CreatedTime\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.createdTime = OffsetDateTime.parse(xmlReader.getStringElement());\n } else if (\"MessagingSKU\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.messagingSku = MessagingSku.fromString(xmlReader.getStringElement());\n } else if (\"MessagingUnits\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.messagingUnits = xmlReader.getIntElement();\n } else if (\"ModifiedTime\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.modifiedTime = OffsetDateTime.parse(xmlReader.getStringElement());\n } else if (\"Name\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.name = xmlReader.getStringElement();\n } else if (\"NamespaceType\".equals(localPart)\n && \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\".equals(namespaceUri)) {\n properties.namespaceType = NamespaceType.fromString(xmlReader.getStringElement());\n }\n }\n\n return properties;\n });\n```"
returns:
description: "An instance of the expected object,"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.close()"
fullName: "com.azure.xml.XmlReader.close()"
name: "close()"
nameWithType: "XmlReader.close()"
summary: "Closes the XML stream."
syntax: "public void close()"
exceptions:
- description: "If the underlying content store fails to close."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Closes the XML stream."
- uid: "com.azure.xml.XmlReader.currentToken()"
fullName: "com.azure.xml.XmlReader.currentToken()"
name: "currentToken()"
nameWithType: "XmlReader.currentToken()"
summary: "Gets the <xref uid=\"com.azure.xml.XmlToken\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken\"></xref> that the reader points to currently."
syntax: "public XmlToken currentToken()"
desc: "Gets the <xref uid=\"com.azure.xml.XmlToken\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken\"></xref> that the reader points to currently.\n\nReturns <xref uid=\"com.azure.xml.XmlToken.START_DOCUMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_DOCUMENT\"></xref> if the reader hasn't begun reading the XML stream. Returns <xref uid=\"com.azure.xml.XmlToken.END_DOCUMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_DOCUMENT\"></xref> if the reader has completed reading the XML stream."
returns:
description: "The <xref uid=\"com.azure.xml.XmlToken\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken\"></xref> that the reader points to currently."
type: "<xref href=\"com.azure.xml.XmlToken?alt=com.azure.xml.XmlToken&text=XmlToken\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.fromBytes(byte[])"
fullName: "com.azure.xml.XmlReader.fromBytes(byte[] xml)"
name: "fromBytes(byte[] xml)"
nameWithType: "XmlReader.fromBytes(byte[] xml)"
summary: "Creates an <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref>\\-based <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`."
modifiers:
- "static"
parameters:
- description: "The XML to parse."
name: "xml"
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
syntax: "public static XmlReader fromBytes(byte[] xml)"
exceptions:
- description: "If <code>xml</code> is null."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Creates an <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref>\\-based <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`.\n\nThis uses the <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> implementation provided by the default <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLInputFactory#newInstance()\"></xref>. If you need to provide a custom implementation of <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> use <xref uid=\"com.azure.xml.XmlReader.fromXmlStreamReader(javax.xml.stream.XMLStreamReader)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#fromXmlStreamReader(XMLStreamReader)\"></xref>."
returns:
description: "A new <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> instance."
type: "<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.fromReader(java.io.Reader)"
fullName: "com.azure.xml.XmlReader.fromReader(Reader xml)"
name: "fromReader(Reader xml)"
nameWithType: "XmlReader.fromReader(Reader xml)"
summary: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`."
modifiers:
- "static"
parameters:
- description: "The XML to parse."
name: "xml"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html\">Reader</a>"
syntax: "public static XmlReader fromReader(Reader xml)"
exceptions:
- description: "If <code>xml</code> is null."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`.\n\nThis uses the <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> implementation provided by the default <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLInputFactory#newInstance()\"></xref>. If you need to provide a custom implementation of <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> use <xref uid=\"com.azure.xml.XmlReader.fromXmlStreamReader(javax.xml.stream.XMLStreamReader)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#fromXmlStreamReader(XMLStreamReader)\"></xref>."
returns:
description: "A new <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> instance."
type: "<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.fromStream(java.io.InputStream)"
fullName: "com.azure.xml.XmlReader.fromStream(InputStream xml)"
name: "fromStream(InputStream xml)"
nameWithType: "XmlReader.fromStream(InputStream xml)"
summary: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`."
modifiers:
- "static"
parameters:
- description: "The XML to parse."
name: "xml"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html\">InputStream</a>"
syntax: "public static XmlReader fromStream(InputStream xml)"
exceptions:
- description: "If <code>xml</code> is null."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`.\n\nThis uses the <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> implementation provided by the default <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLInputFactory#newInstance()\"></xref>. If you need to provide a custom implementation of <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> use <xref uid=\"com.azure.xml.XmlReader.fromXmlStreamReader(javax.xml.stream.XMLStreamReader)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#fromXmlStreamReader(XMLStreamReader)\"></xref>."
returns:
description: "A new <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> instance."
type: "<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.fromString(java.lang.String)"
fullName: "com.azure.xml.XmlReader.fromString(String xml)"
name: "fromString(String xml)"
nameWithType: "XmlReader.fromString(String xml)"
summary: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`."
modifiers:
- "static"
parameters:
- description: "The XML to parse."
name: "xml"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static XmlReader fromString(String xml)"
exceptions:
- description: "If <code>xml</code> is null."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`.\n\nThis uses the <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> implementation provided by the default <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLInputFactory#newInstance()\"></xref>. If you need to provide a custom implementation of <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> use <xref uid=\"com.azure.xml.XmlReader.fromXmlStreamReader(javax.xml.stream.XMLStreamReader)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#fromXmlStreamReader(XMLStreamReader)\"></xref>."
returns:
description: "A new <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> instance."
type: "<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.fromXmlStreamReader(javax.xml.stream.XMLStreamReader)"
fullName: "com.azure.xml.XmlReader.fromXmlStreamReader(XMLStreamReader reader)"
name: "fromXmlStreamReader(XMLStreamReader reader)"
nameWithType: "XmlReader.fromXmlStreamReader(XMLStreamReader reader)"
summary: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`."
modifiers:
- "static"
parameters:
- description: "The <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> to parse the XML."
name: "reader"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamReader.html\">XMLStreamReader</a>"
syntax: "public static XmlReader fromXmlStreamReader(XMLStreamReader reader)"
desc: "Creates an <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> that parses the passed `xml`.\n\nThis uses the provided <xref uid=\"javax.xml.stream.XMLStreamReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XMLStreamReader\"></xref> implementation to parse the XML."
returns:
description: "A new <xref uid=\"com.azure.xml.XmlReader\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlReader\"></xref> instance."
type: "<xref href=\"com.azure.xml.XmlReader?alt=com.azure.xml.XmlReader&text=XmlReader\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getBinaryAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getBinaryAttribute(String namespaceUri, String localName)"
name: "getBinaryAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getBinaryAttribute(String namespaceUri, String localName)"
summary: "Gets the binary value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public byte[] getBinaryAttribute(String namespaceUri, String localName)"
desc: "Gets the binary value for the attribute in the XML element."
returns:
description: "The binary value for the attribute in the XML element."
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
- uid: "com.azure.xml.XmlReader.getBinaryElement()"
fullName: "com.azure.xml.XmlReader.getBinaryElement()"
name: "getBinaryElement()"
nameWithType: "XmlReader.getBinaryElement()"
summary: "Gets the binary value for the current element."
syntax: "public byte[] getBinaryElement()"
exceptions:
- description: "If the binary element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the binary value for the current element."
returns:
description: "The binary value for the current element."
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
- uid: "com.azure.xml.XmlReader.getBooleanAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getBooleanAttribute(String namespaceUri, String localName)"
name: "getBooleanAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getBooleanAttribute(String namespaceUri, String localName)"
summary: "Gets the boolean value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public boolean getBooleanAttribute(String namespaceUri, String localName)"
desc: "Gets the boolean value for the attribute in the XML element."
returns:
description: "The boolean value for the attribute in the XML element."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getBooleanElement()"
fullName: "com.azure.xml.XmlReader.getBooleanElement()"
name: "getBooleanElement()"
nameWithType: "XmlReader.getBooleanElement()"
summary: "Gets the boolean value for the current element."
syntax: "public boolean getBooleanElement()"
exceptions:
- description: "If the boolean element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the boolean value for the current element."
returns:
description: "The boolean value for the current element."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getDoubleAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getDoubleAttribute(String namespaceUri, String localName)"
name: "getDoubleAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getDoubleAttribute(String namespaceUri, String localName)"
summary: "Gets the double value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public double getDoubleAttribute(String namespaceUri, String localName)"
desc: "Gets the double value for the attribute in the XML element."
returns:
description: "The double value for the attribute in the XML element."
type: "<xref href=\"double?alt=double&text=double\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getDoubleElement()"
fullName: "com.azure.xml.XmlReader.getDoubleElement()"
name: "getDoubleElement()"
nameWithType: "XmlReader.getDoubleElement()"
summary: "Gets the double value for the current element."
syntax: "public double getDoubleElement()"
exceptions:
- description: "If the double element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the double value for the current element."
returns:
description: "The double value for the current element."
type: "<xref href=\"double?alt=double&text=double\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getElementName()"
fullName: "com.azure.xml.XmlReader.getElementName()"
name: "getElementName()"
nameWithType: "XmlReader.getElementName()"
summary: "Gets the <xref uid=\"javax.xml.namespace.QName\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QName\"></xref> for the current XML element."
syntax: "public QName getElementName()"
desc: "Gets the <xref uid=\"javax.xml.namespace.QName\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QName\"></xref> for the current XML element.\n\n**Code Samples**\n\n```java\nQName qName = xmlReader.getElementName();\n String localPart = qName.getLocalPart(); // The name of the XML element.\n String namespaceUri = qName.getNamespaceURI(); // The namespace of the XML element.\n```"
returns:
description: "The <xref uid=\"javax.xml.namespace.QName\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QName\"></xref> for the current XML element."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/namespace/QName.html\">QName</a>"
- uid: "com.azure.xml.XmlReader.getFloatAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getFloatAttribute(String namespaceUri, String localName)"
name: "getFloatAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getFloatAttribute(String namespaceUri, String localName)"
summary: "Gets the float value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public float getFloatAttribute(String namespaceUri, String localName)"
desc: "Gets the float value for the attribute in the XML element."
returns:
description: "The float value for the attribute in the XML element."
type: "<xref href=\"float?alt=float&text=float\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getFloatElement()"
fullName: "com.azure.xml.XmlReader.getFloatElement()"
name: "getFloatElement()"
nameWithType: "XmlReader.getFloatElement()"
summary: "Gets the float value for the current element."
syntax: "public float getFloatElement()"
exceptions:
- description: "If the float element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the float value for the current element."
returns:
description: "The float value for the current element."
type: "<xref href=\"float?alt=float&text=float\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getIntAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getIntAttribute(String namespaceUri, String localName)"
name: "getIntAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getIntAttribute(String namespaceUri, String localName)"
summary: "Gets the int value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public int getIntAttribute(String namespaceUri, String localName)"
desc: "Gets the int value for the attribute in the XML element."
returns:
description: "The int value for the attribute in the XML element."
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getIntElement()"
fullName: "com.azure.xml.XmlReader.getIntElement()"
name: "getIntElement()"
nameWithType: "XmlReader.getIntElement()"
summary: "Gets the int value for the current element."
syntax: "public int getIntElement()"
exceptions:
- description: "If the int element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the int value for the current element."
returns:
description: "The int value for the current element."
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getLongAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getLongAttribute(String namespaceUri, String localName)"
name: "getLongAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getLongAttribute(String namespaceUri, String localName)"
summary: "Gets the long value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public long getLongAttribute(String namespaceUri, String localName)"
desc: "Gets the long value for the attribute in the XML element."
returns:
description: "The long value for the attribute in the XML element."
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getLongElement()"
fullName: "com.azure.xml.XmlReader.getLongElement()"
name: "getLongElement()"
nameWithType: "XmlReader.getLongElement()"
summary: "Gets the long value for the current element."
syntax: "public long getLongElement()"
exceptions:
- description: "If the long element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the long value for the current element."
returns:
description: "The long value for the current element."
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.getStringAttribute(java.lang.String,java.lang.String)"
fullName: "com.azure.xml.XmlReader.getStringAttribute(String namespaceUri, String localName)"
name: "getStringAttribute(String namespaceUri, String localName)"
nameWithType: "XmlReader.getStringAttribute(String namespaceUri, String localName)"
summary: "Gets the string value for the attribute in the XML element."
parameters:
- description: "Attribute namespace, may be null."
name: "namespaceUri"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Attribute local name."
name: "localName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public String getStringAttribute(String namespaceUri, String localName)"
desc: "Gets the string value for the attribute in the XML element.\n\nNull is returned if the attribute doesn't exist in the XML element."
returns:
description: "The string value for the attribute in the XML element, or null if the attribute doesn't exist."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.xml.XmlReader.getStringElement()"
fullName: "com.azure.xml.XmlReader.getStringElement()"
name: "getStringElement()"
nameWithType: "XmlReader.getStringElement()"
summary: "Gets the string value for the current element."
syntax: "public String getStringElement()"
exceptions:
- description: "If the String element cannot be read."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Gets the string value for the current element."
returns:
description: "The string value for the current element."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.xml.XmlReader.nextElement()"
fullName: "com.azure.xml.XmlReader.nextElement()"
name: "nextElement()"
nameWithType: "XmlReader.nextElement()"
summary: "Iterates to and returns the next <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> or <xref uid=\"com.azure.xml.XmlToken.END_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_ELEMENT\"></xref> in the XML stream."
syntax: "public XmlToken nextElement()"
exceptions:
- description: "If the next element cannot be determined."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Iterates to and returns the next <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> or <xref uid=\"com.azure.xml.XmlToken.END_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_ELEMENT\"></xref> in the XML stream.\n\nReturns <xref uid=\"com.azure.xml.XmlToken.END_DOCUMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_DOCUMENT\"></xref> if iterating to the next element token completes reading of the XML stream."
returns:
description: "The next <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> or <xref uid=\"com.azure.xml.XmlToken.END_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_ELEMENT\"></xref> in the XML stream, or\n <xref uid=\"com.azure.xml.XmlToken.END_DOCUMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_DOCUMENT\"></xref> if reading completes."
type: "<xref href=\"com.azure.xml.XmlToken?alt=com.azure.xml.XmlToken&text=XmlToken\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.xml.XmlReader.skipElement()"
fullName: "com.azure.xml.XmlReader.skipElement()"
name: "skipElement()"
nameWithType: "XmlReader.skipElement()"
summary: "Skips the current XML element."
syntax: "public void skipElement()"
exceptions:
- description: "If skipping the element fails."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamException.html\">XMLStreamException</a>"
desc: "Skips the current XML element.\n\nIf the <xref uid=\"com.azure.xml.XmlReader.currentToken()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#currentToken()\"></xref> isn't an <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref> this is a no-op.\n\nThis reads the XML stream until the matching <xref uid=\"com.azure.xml.XmlToken.END_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#END_ELEMENT\"></xref> is found for the current <xref uid=\"com.azure.xml.XmlToken.START_ELEMENT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"XmlToken#START_ELEMENT\"></xref>."
type: "class"
desc: "Reads an XML encoded value as a stream of tokens."
implements:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
metadata: {}
package: "com.azure.xml"
artifact: com.azure:azure-xml:1.1.0