当前位置: 首页>>代码示例>>Java>>正文


Java WireFeed.getFeedType方法代码示例

本文整理汇总了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);
    }
    
}
 
开发者ID:4thline,项目名称:feeds,代码行数:27,代码来源:SyndFeedImpl.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:SyndFeedImpl.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:WireFeedOutput.java

示例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);
}
 
开发者ID:4thline,项目名称:feeds,代码行数:28,代码来源:WireFeedOutput.java


注:本文中的com.sun.syndication.feed.WireFeed.getFeedType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。