parser


stáhnout snippet
zobrazení: SyntaxHighlighter | GeSHi | Holý text
public class Feed<T extends Entry> {
	
	@Key("title")
	public String title;
	
	@Key("updated")
	public String updated;
	
	@Key("id")
	public String id;

	@Key("openSearch:startIndex")
	public int startIndex;
	
	@Key("openSearch:totalResults")
	public int totalResults;

	@Key("openSearch:itemsPerPage")
	public int itemsPerPage;

	@Key("link")
	public List<Link> links;

	@Key("entry")
	public List<T> entries = new ArrayList<T>();
	
	public static <T extends Entry> Feed<T> executeGet(HttpRequest request) throws IOException {
		
		HttpResponse response = request.execute();
		return response.parseAs(Feed.class);
	}

	public List<T> getFeedEntries() {
		
		return entries;
	}
}


java 37 řádků | 2011-10-06 20:22:33