com.google.api.client.googleapis.json
Class JsonFeedParser<T,I>
java.lang.Object
com.google.api.client.googleapis.json.AbstractJsonFeedParser<T>
com.google.api.client.googleapis.json.JsonFeedParser<T,I>
- Type Parameters:
T
- feed typeI
- item type
public final class JsonFeedParser<T,I>
- extends AbstractJsonFeedParser<T>
Google JSON-C feed parser when the item class is known in advance.
- Since:
- 1.0
- Author:
- Yaniv Inbar
Method Summary |
I |
parseNextItem()
Parse the next item in the feed and return a new parsed instance of the item class. |
static
|
use(JsonFactory jsonFactory,
HttpResponse response,
Class<T> feedClass,
Class<I> itemClass)
Parses the given HTTP response using the given feed class and item class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonFeedParser
public JsonFeedParser(JsonParser parser,
Class<T> feedClass,
Class<I> itemClass)
- Parameters:
parser
- JSON parserfeedClass
- feed classitemClass
- item class
parseNextItem
public I parseNextItem()
throws IOException
- Description copied from class:
AbstractJsonFeedParser
- Parse the next item in the feed and return a new parsed instance of the item class. If there is
no item to parse, it will return
null
and automatically close the parser (in which case
there is no need to call AbstractJsonFeedParser.close()
.
- Overrides:
parseNextItem
in class AbstractJsonFeedParser<T>
- Throws:
IOException
use
public static <T,I> JsonFeedParser<T,I> use(JsonFactory jsonFactory,
HttpResponse response,
Class<T> feedClass,
Class<I> itemClass)
throws IOException
- Parses the given HTTP response using the given feed class and item class.
- Parameters:
jsonFactory
- JSON factoryresponse
- HTTP responsefeedClass
- feed classitemClass
- item class
- Throws:
IOException
- Since:
- 1.3
Copyright © 2010-2011 Google. All Rights Reserved.