* @throws XMLStreamException if malformed xml is read in stream
* @throws EntityProviderException if xml contains invalid data (based on odata specification and edm definition)
*/
private ODataDeltaFeed readFeedData(final XMLStreamReader reader, final EntityInfoAggregator eia,
final EntityProviderReadProperties entryReadProperties) throws XMLStreamException, EntityProviderException {
FeedMetadataImpl metadata = new FeedMetadataImpl();
XmlEntryConsumer xec = new XmlEntryConsumer();
List<ODataEntry> results = new ArrayList<ODataEntry>();
List<DeletedEntryMetadata> deletedEntries = new ArrayList<DeletedEntryMetadata>();
while (reader.hasNext() && !isFeedEndTag(reader)) {
if (FormatXml.ATOM_ENTRY.equals(reader.getLocalName())) {
ODataEntry entry = xec.readEntry(reader, eia, entryReadProperties, true);
results.add(entry);
} else if (FormatXml.ATOM_TOMBSTONE_DELETED_ENTRY.equals(reader.getLocalName())) {
reader.require(XMLStreamConstants.START_ELEMENT, FormatXml.ATOM_TOMBSTONE_NAMESPACE,
FormatXml.ATOM_TOMBSTONE_DELETED_ENTRY);
DeletedEntryMetadataImpl deletedEntryMetadata = readDeletedEntryMetadata(reader);
deletedEntries.add(deletedEntryMetadata);
reader.next();
} else if (FormatXml.M_COUNT.equals(reader.getLocalName())) {
reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_COUNT);
readInlineCount(reader, metadata);
} else if (FormatXml.ATOM_LINK.equals(reader.getLocalName())) {
reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_LINK);
final String rel = reader.getAttributeValue(null, FormatXml.ATOM_REL);
if (FormatXml.ATOM_NEXT_LINK.equals(rel)) {
final String uri = reader.getAttributeValue(null, FormatXml.ATOM_HREF);
metadata.setNextLink(uri);
} else if (FormatXml.ATOM_DELTA_LINK.equals(rel)) {
final String uri = reader.getAttributeValue(null, FormatXml.ATOM_HREF);
metadata.setDeltaLink(uri);
}
reader.next();
} else {
reader.next();
}