public interface XMLReader
| Modifier and Type | Method and Description |
|---|---|
void |
closeReader()
Closes the underlying reader.
|
int |
getAttributeCount()
Returns the count of attributes on this start element.
|
String |
getAttributeValue(String attributeName)
Reads the value of the XML attribute with the given name.
|
String |
getElementName()
Reads the name of the current XML element.
|
String |
getElementValue()
Reads the value of the current XML element.
|
XMLStreamReader |
getXmlStreamReader()
Provides the underlying XMLStreamReader.
|
boolean |
isEndElement(String name)
Checks whether the current XML element is an end element with the given name.
|
boolean |
isStartElement(String name)
Checks whether the current XML element is a start element with the given name.
|
void |
moveToStartElement(String name)
Moves the cursor to the first XML start element with the given name in the document.
|
boolean |
moveToStartElement(String startElementName,
String endElementName)
Moves the cursor to the first XML start element with the given name in the document.
|
boolean |
next()
Moves the cursor to the next XML element in the document.
|
boolean |
next(String endElementName)
Moves the cursor to the next XML element in the document.
|
Map<String,String> |
readElements(String elementName)
Reads values for all properties for an element into a Map, where the key
is the property and the value is the value.
|
String getElementName()
String getElementValue()
void moveToStartElement(String name)
name - The name of the XML element to move to.boolean moveToStartElement(String startElementName, String endElementName)
startElementName - The name of the XML start element to move to.endElementName - The name of the XML end element to stop moving forward at.boolean isStartElement(String name)
name - The name of the XML element.boolean isEndElement(String name)
name - The name of the XML element.boolean next()
boolean next(String endElementName)
endElementName - The name of the end element.String getAttributeValue(String attributeName)
attributeName - The name of the attribute.int getAttributeCount()
Map<String,String> readElements(String elementName)
elementName - the name of the XML element.XMLStreamReader getXmlStreamReader()
void closeReader()
Copyright © 2015 AmpleCode. All rights reserved.