* @param review The review issue to add the metadata to.
* @throws XMLStreamException Thrown if there is an error while reading from the stream.
*/
private static void parseReviewIssueMeta(XMLStreamReader reader, ReviewIssue reviewIssue)
throws XMLStreamException {
ReviewIssueMeta meta = new ReviewIssueMeta();
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 (ELEMENT_CREATION_DATE.equals(elementName)) {
CreationDate creationDate = new CreationDate();
creationDate.setFormat(reader.getAttributeValue(null, ATTRIBUTE_FORMAT));
// get the CHARACTERS event to get the date string
eventType = reader.next();
if (eventType == XMLStreamConstants.CHARACTERS) {
creationDate.setValue(reader.getText());
}
meta.setCreationDate(creationDate);
}
else if (ELEMENT_LAST_MODIFICATION_DATE.equals(elementName)) {
LastModificationDate lastModDate = new LastModificationDate();
lastModDate.setFormat(reader.getAttributeValue(null, ATTRIBUTE_FORMAT));
// get the CHARACTERS event to get the date string
eventType = reader.next();
if (eventType == XMLStreamConstants.CHARACTERS) {
lastModDate.setValue(reader.getText());
}
meta.setLastModificationDate(lastModDate);
}
}
else if (eventType == XMLStreamConstants.END_ELEMENT) {
QName elementQName = reader.getName();