* @param reader The XML stream reader to read from.
* @param review The review to add the reviewers to.
*/
private static void parseReviewers(XMLStreamReader reader, Review review)
throws XMLStreamException {
Reviewers reviewers = new Reviewers();
boolean endFound = false;
while (!endFound) {
if (reader.hasNext()) {
int eventType = reader.next();
if (eventType == XMLStreamConstants.START_ELEMENT) {
QName elementQName = reader.getName();
String elementName = elementQName.toString();
if (PropertyConstraints.ELEMENT_ENTRY.equals(elementName)) {
// this is an entry for reviewers
String id = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_ID);
String name = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_NAME);
Reviewers.Entry entry = new Reviewers.Entry();
entry.setId(id);
entry.setName(name);
reviewers.getEntry().add(entry);
}
}
else if (eventType == XMLStreamConstants.END_ELEMENT) {
QName elementQName = reader.getName();