/** * Parse the next item in the feed and return a new parsed instance of the item type. If there is * no item to parse, it will return {@code null} and automatically close the parser (in which case * there is no need to call {@link #close()}. * * @throws IOException I/O exception * @throws XmlPullParserException XML pull parser exception */ public Object parseNextEntry() throws IOException, XmlPullParserException { if (!feedParsed) { feedParsed = true; Xml.parseElement(parser, null, namespaceDictionary, Atom.StopAtAtomEntry.INSTANCE); } boolean close = true; try { if (parser.getEventType() == XmlPullParser.START_TAG) { Object result = parseEntryInternal(); parser.next(); close = false; return result; } } finally { if (close) { close(); } } return null; }