1 16 package web.rss; 17 18 import java.io.Reader ; 19 20 import org.apache.commons.digester.Digester; 21 22 26 public class _RSSHunter extends RssHunter { 27 28 31 protected Channel parse(Reader content) throws Exception { 32 Digester dig = getDigester(); 33 dig.addBeanPropertySetter("rss/channel/title","title"); 34 dig.addBeanPropertySetter("rss/channel/link","link"); 35 dig.addBeanPropertySetter("rss/channel/description","description"); 36 dig.addObjectCreate("rss/channel/item", Item.class); 37 dig.addSetNext("rss/channel/item","addItem"); 38 dig.addBeanPropertySetter("rss/channel/item/title","title"); 39 dig.addBeanPropertySetter("rss/channel/item/link","link"); 40 dig.addBeanPropertySetter("rss/channel/item/description","description"); 41 42 return (Channel)dig.parse(content); 43 } 44 45 } 46 | Popular Tags |