Class AbstractAtomFeedParser<T>
java.lang.Object
com.google.api.client.xml.atom.AbstractAtomFeedParser<T>
- Type Parameters:
T- feed type
- Direct Known Subclasses:
AtomFeedParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionFeed class to parse.private booleanWhether the feed has been parsed.private final InputStreamInput stream to read.private final XmlNamespaceDictionaryXML namespace dictionary.private final org.xmlpull.v1.XmlPullParserXML pull parser to use. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, org.xmlpull.v1.XmlPullParser parser, InputStream inputStream, Class<T> feedClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying parser.Returns the feed class to parse.final InputStreamReturns the input stream to read.final XmlNamespaceDictionaryReturns the XML namespace dictionary.final org.xmlpull.v1.XmlPullParserReturns the XML pull parser to use.protected abstract ObjectParses a single entry.Parse the feed and return a new parsed instance of the feed type.Parse the next item in the feed and return a new parsed instance of the item type.
-
Field Details
-
feedParsed
private boolean feedParsedWhether the feed has been parsed. -
parser
private final org.xmlpull.v1.XmlPullParser parserXML pull parser to use. -
inputStream
Input stream to read. -
feedClass
-
namespaceDictionary
XML namespace dictionary.
-
-
Constructor Details
-
AbstractAtomFeedParser
protected AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, org.xmlpull.v1.XmlPullParser parser, InputStream inputStream, Class<T> feedClass) - Parameters:
namespaceDictionary- XML namespace dictionaryparser- XML pull parser to useinputStream- input stream to readfeedClass- feed class to parse- Since:
- 1.5
-
-
Method Details
-
getParser
public final org.xmlpull.v1.XmlPullParser getParser()Returns the XML pull parser to use.- Since:
- 1.5
-
getInputStream
-
getFeedClass
-
getNamespaceDictionary
Returns the XML namespace dictionary.- Since:
- 1.5
-
parseFeed
Parse the feed and return a new parsed instance of the feed type. This method can be skipped if all you want are the items.- Throws:
IOException- I/O exceptionorg.xmlpull.v1.XmlPullParserException- XML pull parser exception
-
parseNextEntry
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 returnnulland automatically close the parser (in which case there is no need to callclose().- Throws:
IOException- I/O exceptionorg.xmlpull.v1.XmlPullParserException- XML pull parser exception
-
close
-
parseEntryInternal
protected abstract Object parseEntryInternal() throws IOException, org.xmlpull.v1.XmlPullParserExceptionParses a single entry.- Returns:
- object representing the entry
- Throws:
IOException- I/O exceptionorg.xmlpull.v1.XmlPullParserException- XML pull parser exception
-