本文整理汇总了Java中com.sun.syndication.feed.rss.Channel.setWebMaster方法的典型用法代码示例。如果您正苦于以下问题:Java Channel.setWebMaster方法的具体用法?Java Channel.setWebMaster怎么用?Java Channel.setWebMaster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.rss.Channel
的用法示例。
在下文中一共展示了Channel.setWebMaster方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseChannel
import com.sun.syndication.feed.rss.Channel; //导入方法依赖的package包/类
/**
* Parses the root element of an RSS document into a Channel bean.
* <p/>
* It first invokes super.parseChannel and then parses and injects the following
* properties if present: language, pubDate, rating and copyright.
* <p/>
*
* @param rssRoot the root element of the RSS document to parse.
* @return the parsed Channel bean.
*/
protected WireFeed parseChannel(Element rssRoot) {
Channel channel = (Channel) super.parseChannel(rssRoot);
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
Element e = eChannel.getChild("language",getRSSNamespace());
if (e!=null) {
channel.setLanguage(e.getText());
}
e = eChannel.getChild("rating",getRSSNamespace());
if (e!=null) {
channel.setRating(e.getText());
}
e = eChannel.getChild("copyright",getRSSNamespace());
if (e!=null) {
channel.setCopyright(e.getText());
}
e = eChannel.getChild("pubDate",getRSSNamespace());
if (e!=null) {
channel.setPubDate(DateParser.parseRFC822(e.getText()));
}
e = eChannel.getChild("lastBuildDate",getRSSNamespace());
if (e!=null) {
channel.setLastBuildDate(DateParser.parseRFC822(e.getText()));
}
e = eChannel.getChild("docs",getRSSNamespace());
if (e!=null) {
channel.setDocs(e.getText());
}
e = eChannel.getChild("docs",getRSSNamespace());
if (e!=null) {
channel.setDocs(e.getText());
}
e = eChannel.getChild("managingEditor",getRSSNamespace());
if (e!=null) {
channel.setManagingEditor(e.getText());
}
e = eChannel.getChild("webMaster",getRSSNamespace());
if (e!=null) {
channel.setWebMaster(e.getText());
}
e = eChannel.getChild("skipHours");
if (e!=null) {
List skipHours = new ArrayList();
List eHours = e.getChildren("hour",getRSSNamespace());
for (int i=0;i<eHours.size();i++) {
Element eHour = (Element) eHours.get(i);
skipHours.add(new Integer(eHour.getText().trim()));
}
channel.setSkipHours(skipHours);
}
e = eChannel.getChild("skipDays");
if (e!=null) {
List skipDays = new ArrayList();
List eDays = e.getChildren("day",getRSSNamespace());
for (int i=0;i<eDays.size();i++) {
Element eDay = (Element) eDays.get(i);
skipDays.add(eDay.getText().trim());
}
channel.setSkipDays(skipDays);
}
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 first invokes super.parseChannel and then parses and injects the following
* properties if present: language, pubDate, rating and copyright.
* <p/>
*
* @param rssRoot the root element of the RSS document to parse.
* @return the parsed Channel bean.
*/
protected WireFeed parseChannel(Element rssRoot) {
Channel channel = (Channel) super.parseChannel(rssRoot);
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
Element e = eChannel.getChild("language",getRSSNamespace());
if (e!=null) {
channel.setLanguage(e.getText());
}
e = eChannel.getChild("rating",getRSSNamespace());
if (e!=null) {
channel.setRating(e.getText());
}
e = eChannel.getChild("copyright",getRSSNamespace());
if (e!=null) {
channel.setCopyright(e.getText());
}
e = eChannel.getChild("pubDate",getRSSNamespace());
if (e!=null) {
channel.setPubDate(DateParser.parseDate(e.getText()));
}
e = eChannel.getChild("lastBuildDate",getRSSNamespace());
if (e!=null) {
channel.setLastBuildDate(DateParser.parseDate(e.getText()));
}
e = eChannel.getChild("docs",getRSSNamespace());
if (e!=null) {
channel.setDocs(e.getText());
}
e = eChannel.getChild("docs",getRSSNamespace());
if (e!=null) {
channel.setDocs(e.getText());
}
e = eChannel.getChild("managingEditor",getRSSNamespace());
if (e!=null) {
channel.setManagingEditor(e.getText());
}
e = eChannel.getChild("webMaster",getRSSNamespace());
if (e!=null) {
channel.setWebMaster(e.getText());
}
e = eChannel.getChild("skipHours");
if (e!=null) {
List skipHours = new ArrayList();
List eHours = e.getChildren("hour",getRSSNamespace());
for (int i=0;i<eHours.size();i++) {
Element eHour = (Element) eHours.get(i);
skipHours.add(new Integer(eHour.getText().trim()));
}
channel.setSkipHours(skipHours);
}
e = eChannel.getChild("skipDays");
if (e!=null) {
List skipDays = new ArrayList();
List eDays = e.getChildren("day",getRSSNamespace());
for (int i=0;i<eDays.size();i++) {
Element eDay = (Element) eDays.get(i);
skipDays.add(eDay.getText().trim());
}
channel.setSkipDays(skipDays);
}
return channel;
}