本文整理汇总了Java中com.sun.syndication.feed.rss.Channel.setCategories方法的典型用法代码示例。如果您正苦于以下问题:Java Channel.setCategories方法的具体用法?Java Channel.setCategories怎么用?Java Channel.setCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.rss.Channel
的用法示例。
在下文中一共展示了Channel.setCategories方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseChannel
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
protected WireFeed parseChannel(Element rssRoot) {
Channel channel = (Channel) super.parseChannel(rssRoot);
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
List eCats = eChannel.getChildren("category",getRSSNamespace());
channel.setCategories(parseCategories(eCats));
Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
if (eTtl!=null) {
Integer ttlValue = new Integer(eTtl.getText());
if (ttlValue != null) {
channel.setTtl(ttlValue.intValue());
}
}
return channel;
}
示例2: parseChannel
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
protected WireFeed parseChannel(Element rssRoot) {
Channel channel = (Channel) super.parseChannel(rssRoot);
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
List eCats = eChannel.getChildren("category",getRSSNamespace());
channel.setCategories(parseCategories(eCats));
Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
if (eTtl!=null && eTtl.getText() != null ) {
Integer ttlValue = null;
try{
ttlValue = new Integer(eTtl.getText());
} catch(NumberFormatException nfe ){
; //let it go by
}
if (ttlValue != null) {
channel.setTtl(ttlValue.intValue());
}
}
return channel;
}
示例3: createRealFeed
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
List cats = syndFeed.getCategories(); //c
if (cats.size()>0) {
channel.setCategories(createRSSCategories(cats));
}
return channel;
}
示例4: createRealFeed
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
@Override
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
List cats = syndFeed.getCategories(); //c
if (cats.size()>0) {
channel.setCategories(createRSSCategories(cats));
}
return channel;
}