本文整理汇总了Java中com.sun.syndication.feed.rss.Channel.setModules方法的典型用法代码示例。如果您正苦于以下问题:Java Channel.setModules方法的具体用法?Java Channel.setModules怎么用?Java Channel.setModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.rss.Channel
的用法示例。
在下文中一共展示了Channel.setModules方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRealFeed
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = new Channel(type);
channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));
channel.setEncoding(syndFeed.getEncoding());
channel.setTitle(syndFeed.getTitle());
channel.setLink(syndFeed.getLink());
channel.setDescription(syndFeed.getDescription());
SyndImage sImage = syndFeed.getImage();
if (sImage!=null) {
channel.setImage(createRSSImage(sImage));
}
List sEntries = syndFeed.getEntries();
if (sEntries!=null) {
channel.setItems(createRSSItems(sEntries));
}
return channel;
}
示例2: parseChannel
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
/**
* Parses the root element of an RSS document into a Channel bean.
* <p/>
* It reads title, link and description and delegates to parseImage, parseItems
* and parseTextInput. This delegation always passes the root element of the RSS
* document as different RSS version may have this information in different parts
* of the XML tree (no assumptions made thanks to the specs variaty)
* <p/>
*
* @param rssRoot the root element of the RSS document to parse.
* @return the parsed Channel bean.
*/
protected WireFeed parseChannel(Element rssRoot) {
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
Channel channel = new Channel(getType());
Element e = eChannel.getChild("title",getRSSNamespace());
if (e!=null) {
channel.setTitle(e.getText());
}
e = eChannel.getChild("link",getRSSNamespace());
if (e!=null) {
channel.setLink(e.getText());
}
e = eChannel.getChild("description",getRSSNamespace());
if (e!=null) {
channel.setDescription(e.getText());
}
channel.setImage(parseImage(rssRoot));
channel.setTextInput(parseTextInput(rssRoot));
channel.setItems(parseItems(rssRoot));
channel.setModules(parseFeedModules(eChannel));
return channel;
}
示例3: doSyndication
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
/**
* This puts the pieces together to generate the actual feed.
*
* @param title
* The global title for the podcast
* @param link
* The URL for the feed
* @param description_loc
* Global description of the feed
* @param copyright
* Copyright information
* @param entries
* The list of individual podcasts
* @param feedTyle
* The output feed type (for potential future development). Set to rss_2.0
* @param pubDate
* The date to set the publish date for this feed
*
* @eturn SyndFeed
* The entire podcast stuffed into a SyndFeed object
*/
private Channel doSyndication(Map feedInfo, List entries,
String feedType, Date pubDate, Date lastBuildDate) {
final Channel channel = new Channel();
// FUTURE: How to determine what podcatcher supports and feed that to them
channel.setFeedType(feedType);
channel.setTitle((String) feedInfo.get("title"));
channel.setLanguage(LANGUAGE);
channel.setPubDate(pubDate);
channel.setLastBuildDate(lastBuildDate);
channel.setLink((String) feedInfo.get("url"));
channel.setDescription((String) feedInfo.get("desc"));
channel.setCopyright((String) feedInfo.get("copyright"));
channel.setGenerator((String) feedInfo.get("gen"));
channel.setItems(entries);
// Used to remove the dc: tags from the channel level info
List modules = new ArrayList();
channel.setModules(modules);
return channel;
}
示例4: createRealFeed
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = new Channel(type);
channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));
channel.setEncoding(syndFeed.getEncoding());
channel.setTitle(syndFeed.getTitle());
if (syndFeed.getLink() != null) {
channel.setLink(syndFeed.getLink());
}
else
if (syndFeed.getLinks().size() > 0) {
channel.setLink(((SyndLink)syndFeed.getLinks().get(0)).getHref());
}
channel.setDescription(syndFeed.getDescription());
SyndImage sImage = syndFeed.getImage();
if (sImage!=null) {
channel.setImage(createRSSImage(sImage));
}
List sEntries = syndFeed.getEntries();
if (sEntries!=null) {
channel.setItems(createRSSItems(sEntries));
}
if (((List)syndFeed.getForeignMarkup()).size() > 0) {
channel.setForeignMarkup(syndFeed.getForeignMarkup());
}
return channel;
}
示例5: parseChannel
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
/**
* Parses the root element of an RSS document into a Channel bean.
* <p/>
* It reads title, link and description and delegates to parseImage, parseItems
* and parseTextInput. This delegation always passes the root element of the RSS
* document as different RSS version may have this information in different parts
* of the XML tree (no assumptions made thanks to the specs variaty)
* <p/>
*
* @param rssRoot the root element of the RSS document to parse.
* @return the parsed Channel bean.
*/
protected WireFeed parseChannel(Element rssRoot) {
Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
Channel channel = new Channel(getType());
Element e = eChannel.getChild("title",getRSSNamespace());
if (e!=null) {
channel.setTitle(e.getText());
}
e = eChannel.getChild("link",getRSSNamespace());
if (e!=null) {
channel.setLink(e.getText());
}
e = eChannel.getChild("description",getRSSNamespace());
if (e!=null) {
channel.setDescription(e.getText());
}
channel.setImage(parseImage(rssRoot));
channel.setTextInput(parseTextInput(rssRoot));
// Unfortunately Microsoft's SSE extension has a special case of
// effectively putting the sharing channel module inside the RSS tag
// and not inside the channel itself. So we also need to look for
// channel modules from the root RSS element.
List allFeedModules = new ArrayList();
List rootModules = parseFeedModules(rssRoot);
List channelModules = parseFeedModules(eChannel);
if (rootModules != null) {
allFeedModules.addAll(rootModules);
}
if (channelModules != null) {
allFeedModules.addAll(channelModules);
}
channel.setModules(allFeedModules);
channel.setItems(parseItems(rssRoot));
List foreignMarkup =
extractForeignMarkup(eChannel, channel, getRSSNamespace());
if (foreignMarkup.size() > 0) {
channel.setForeignMarkup(foreignMarkup);
}
return channel;
}