1 package com.sun.syndication.io.impl; 2 3 import com.sun.syndication.feed.WireFeed; 4 import com.sun.syndication.io.WireFeedParser; 5 import org.jdom.Element; 6 7 import java.util.List ; 8 9 12 public abstract class BaseWireFeedParser implements WireFeedParser { 13 14 18 private static final String FEED_MODULE_PARSERS_POSFIX_KEY = ".feed.ModuleParser.classes"; 19 20 24 private static final String ITEM_MODULE_PARSERS_POSFIX_KEY = ".item.ModuleParser.classes"; 25 26 27 private String _type; 28 private ModuleParsers _feedModuleParsers; 29 private ModuleParsers _itemModuleParsers; 30 31 protected BaseWireFeedParser(String type) { 32 _type = type; 33 _feedModuleParsers = new ModuleParsers(type+FEED_MODULE_PARSERS_POSFIX_KEY); 34 _itemModuleParsers = new ModuleParsers(type+ITEM_MODULE_PARSERS_POSFIX_KEY); 35 } 36 37 45 public String getType() { 46 return _type; 47 } 48 49 protected List parseFeedModules(Element feedElement) { 50 return _feedModuleParsers.parseModules(feedElement); 51 } 52 53 protected List parseItemModules(Element itemElement) { 54 return _itemModuleParsers.parseModules(itemElement); 55 } 56 57 } 58 | Popular Tags |