String id = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_ID);
String defaultValue = reader
.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_DEFAULT);
FieldItem fieldItem = new FieldItem();
fieldItem.setId(id);
fieldItem.setDefault(defaultValue);
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 field item
String name = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_NAME);
FieldItem.Entry entry = new FieldItem.Entry();
entry.setName(name);
fieldItem.getEntry().add(entry);
}
}
else if (eventType == XMLStreamConstants.END_ELEMENT) {
QName elementQName = reader.getName();