1 17 package com.sun.syndication.io.impl; 18 19 import com.sun.syndication.io.WireFeedParser; 20 import org.jdom.Document; 21 import java.util.List ; 22 23 39 public class FeedParsers extends PluginManager { 40 41 45 public static final String FEED_PARSERS_KEY = "WireFeedParser.classes"; 46 47 52 public FeedParsers() { 53 super(FEED_PARSERS_KEY); 54 } 55 56 public List getSupportedFeedTypes() { 57 return getKeys(); 58 } 59 60 67 public WireFeedParser getParserFor(Document document) { 68 List parsers = getPlugins(); 69 WireFeedParser parser = null; 70 for (int i=0;parser==null && i<parsers.size();i++) { 71 parser = (WireFeedParser) parsers.get(i); 72 if (!parser.isMyType(document)) { 73 parser = null; 74 } 75 } 76 return parser; 77 } 78 79 protected String getKey(Object obj) { 80 return ((WireFeedParser)obj).getType(); 81 } 82 83 } 84 | Popular Tags |