* @param preference The preference object to populate with the general information.
* @throws XMLStreamException Thrown if there is an error reading from the reader.
*/
private static void parseGeneral(XMLStreamReader reader, Preference preference)
throws XMLStreamException {
General general = new General();
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_UPDATE_URL.equals(elementName)) {
eventType = reader.next(); // we need the CHARACTERS event
if (eventType == XMLStreamConstants.CHARACTERS) {
String updateUrl = reader.getText();
general.setUpdateUrl(updateUrl);
}
}
else if (ELEMENT_ENABLE_UPDATE.equals(elementName)) {
eventType = reader.next(); // we need the CHARACTERS event
if (eventType == XMLStreamConstants.CHARACTERS) {
String enableUpdate = reader.getText();
general.setEnableUpdate(Boolean.valueOf(enableUpdate));
}
}
else if (ELEMENT_ENABLE_FILTER.equals(elementName)) {
eventType = reader.next(); // we need the CHARACTERS event
if (eventType == XMLStreamConstants.CHARACTERS) {
String enableFilter = reader.getText();
general.setEnableFilter(Boolean.valueOf(enableFilter));
}
}
}
else if (eventType == XMLStreamConstants.END_ELEMENT) {
if (ELEMENT_GENERAL.equals(reader.getName().toString())) {