本文整理汇总了Java中com.sun.syndication.feed.WireFeed.getFeedType方法的典型用法代码示例。如果您正苦于以下问题:Java WireFeed.getFeedType方法的具体用法?Java WireFeed.getFeedType怎么用?Java WireFeed.getFeedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.WireFeed
的用法示例。
在下文中一共展示了WireFeed.getFeedType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SyndFeedImpl
import com.sun.syndication.feed.WireFeed; //导入方法依赖的package包/类
/**
* Creates a SyndFeedImpl and populates all its properties out of the
* given RSS Channel or Atom Feed properties, while optionally preserving
* the WireFeed for access via the orignalWireFeed() method.
*
* @param feed
* @param preserveWireFeed
*/
public SyndFeedImpl(WireFeed feed, boolean preserveWireFeed) {
this(SyndFeed.class,IGNORE_PROPERTIES);
if (preserveWireFeed) {
this.wireFeed = feed;
this.preserveWireFeed = preserveWireFeed;
}
if (feed!=null) {
_feedType = feed.getFeedType();
Converter converter = CONVERTERS.getConverter(_feedType);
if (converter==null) {
throw new IllegalArgumentException("Invalid feed type ["+_feedType+"]");
}
converter.copyInto(feed,this);
}
}
示例2: SyndFeedImpl
import com.sun.syndication.feed.WireFeed; //导入方法依赖的package包/类
/**
* Creates a SyndFeedImpl and populates all its properties out of the
* given RSS Channel or Atom Feed properties.
* <p>
* @param feed the RSS Channel or the Atom Feed to populate the properties from.
*
*/
public SyndFeedImpl(WireFeed feed) {
this(SyndFeed.class,IGNORE_PROPERTIES);
if (feed!=null) {
_feedType = feed.getFeedType();
Converter converter = CONVERTERS.getConverter(_feedType);
if (converter==null) {
throw new IllegalArgumentException("Invalid feed type ["+_feedType+"]");
}
converter.copyInto(feed,this);
}
}
示例3: outputJDom
import com.sun.syndication.feed.WireFeed; //导入方法依赖的package包/类
/**
* Creates a JDOM document for the given WireFeed.
* <p>
* This method does not use the feed encoding property.
* <p>
* NOTE: All other output methods delegate to this method.
* <p>
* @param feed Abstract feed to create JDOM document from. The type of the WireFeed must match
* the type given to the FeedOuptut constructor.
* @return the JDOM document for the given WireFeed.
* @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed don't match.
* @throws FeedException thrown if the JDOM document for the feed could not be created.
*
*/
public Document outputJDom(WireFeed feed) throws IllegalArgumentException,FeedException {
String type = feed.getFeedType();
WireFeedGenerator generator = GENERATORS.getGenerator(type);
if (generator==null) {
throw new IllegalArgumentException("Invalid feed type ["+type+"]");
}
if (!generator.getType().equals(type)) {
throw new IllegalArgumentException("WireFeedOutput type["+type+"] and WireFeed type ["+
type+"] don't match");
}
return generator.generate(feed);
}
示例4: outputJDom
import com.sun.syndication.feed.WireFeed; //导入方法依赖的package包/类
/**
* Creates a JDOM document for the given WireFeed.
* <p>
* This method does not use the feed encoding property.
* <p>
* NOTE: All other output methods delegate to this method.
* <p>
* @param feed Abstract feed to create JDOM document from. The type of the WireFeed must match
* the type given to the FeedOuptut constructor.
* @return the JDOM document for the given WireFeed.
* @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed don't match.
* @throws FeedException thrown if the JDOM document for the feed could not be created.
*
*/
public Document outputJDom(WireFeed feed) throws IllegalArgumentException,FeedException {
String type = feed.getFeedType();
WireFeedGenerator generator = getFeedGenerators().getGenerator(type);
if (generator==null) {
throw new IllegalArgumentException("Invalid feed type ["+type+"]");
}
if (!generator.getType().equals(type)) {
throw new IllegalArgumentException("WireFeedOutput type["+type+"] and WireFeed type ["+
type+"] don't match");
}
return generator.generate(feed);
}