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


Java SyndFeed.getAuthors方法代码示例

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndFeed.getAuthors方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getAuthors方法的具体用法?Java SyndFeed.getAuthors怎么用?Java SyndFeed.getAuthors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.syndication.feed.synd.SyndFeed的用法示例。


在下文中一共展示了SyndFeed.getAuthors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRealFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
protected WireFeed createRealFeed(String type, SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type, syndFeed);
    channel.setLanguage(syndFeed.getLanguage()); //c
    channel.setCopyright(syndFeed.getCopyright()); //c
    channel.setPubDate(syndFeed.getPublishedDate()); //c        

    if ((syndFeed.getAuthors() != null) && (syndFeed.getAuthors()
                                                        .size() > 0)) {
        SyndPerson author = (SyndPerson) syndFeed.getAuthors()
                                                 .get(0);
        channel.setManagingEditor(author.getName());
    }

    return channel;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:17,代码来源:ConverterForRSS091Userland.java

示例2: createRealFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type,syndFeed);
    channel.setLanguage(syndFeed.getLanguage());        //c
    channel.setCopyright(syndFeed.getCopyright());      //c
    channel.setPubDate(syndFeed.getPublishedDate());    //c        
    if (syndFeed.getAuthors()!=null && syndFeed.getAuthors().size() > 0) {
        SyndPerson author = (SyndPerson)syndFeed.getAuthors().get(0);
        channel.setManagingEditor(author.getName());  
    }        
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:ConverterForRSS091Userland.java

示例3: createRealFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public WireFeed createRealFeed(SyndFeed syndFeed) {
    Feed aFeed = new Feed(getType());
    aFeed.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));

    aFeed.setEncoding(syndFeed.getEncoding());

    aFeed.setId(syndFeed.getUri());

    aFeed.setTitle(syndFeed.getTitle());

    String sLink = syndFeed.getLink();
    if (sLink!=null) {
        Link link = new Link();
        link.setRel("alternate");
        link.setHref(sLink);
        List list = new ArrayList();
        list.add(link);
        aFeed.setAlternateLinks(list);
    }

    String sDesc = syndFeed.getDescription();
    if (sDesc!=null) {
        Content tagline = new Content();
        tagline.setValue(sDesc);
        aFeed.setTagline(tagline);
    }

    aFeed.setLanguage(syndFeed.getLanguage());

    List authors = syndFeed.getAuthors();
    if (authors!=null && authors.size() > 0) {
        aFeed.setAuthors(createAtomPersons(authors));
    }

    aFeed.setCopyright(syndFeed.getCopyright());

    aFeed.setModified(syndFeed.getPublishedDate());

    List sEntries = syndFeed.getEntries();
    if (sEntries!=null) {
        aFeed.setEntries(createAtomEntries(sEntries));
    }

    return aFeed;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:46,代码来源:ConverterForAtom03.java

示例4: feedUpdate

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
/**
 * Updates feed information such as accessed time and other attributes
 * pertaining feed/channel.
 * 
 * @param feedDB
 * @param feed
 */
@SuppressWarnings("unchecked")
private void feedUpdate(DBObject feedDB, SyndFeed feed) {
	// this field is for RSS Delegate worker to check for stalled threads or
	// threads that crashed and were not able to update used filed back to 0
	feedDB.put("accessedAt", new Date());

	/******** REQUIRED channel elements as defined in RSS 2.0 Specification ********/
	// http://cyber.law.harvard.edu/rss/rss.html#
	// even though this elements are required by specification we
	// cannot trust the source
	if (feed.getTitle() != null)
		feedDB.put("title", feed.getTitle());
	if (feed.getLink() != null)
		feedDB.put("link", feed.getLink());
	if (feed.getDescription() != null)
		feedDB.put("description", feed.getDescription());

	/******** OPTIONAL channel elements as defined in RSS 2.0 Specification ********/
	if (feed.getLanguage() != null)
		feedDB.put("language", feed.getLanguage());
	if (feed.getCopyright() != null)
		feedDB.put("copyright", feed.getCopyright());
	// no specific get method for managing editor and web master in rome
	// library. Using authors instead
	if (feed.getAuthors() != null && feed.getAuthors().size() > 0) {
		ArrayList<BasicDBObject> authors = getAuthors((ArrayList<SyndPerson>) feed
				.getAuthors());
		feedDB.put("authors", authors);
	}
	if (feed.getPublishedDate() != null)
		feedDB.put("pubDate", feed.getPublishedDate());
	// last build date does not exist in rome library
	if (feed.getCategories() != null && feed.getCategories().size() > 0) {
		ArrayList<BasicDBObject> categories = getCategories((ArrayList<SyndCategory>) feed
				.getCategories());
		feedDB.put("category", categories);
	}
	// generator does not exist in rome library
	// docs does not exist in rome library
	// cloud does not exist in rome library
	// ttl does not exist in rome library
	SyndImage feedImage = feed.getImage();
	if (feedImage != null) {
		BasicDBObject imageDB = new BasicDBObject();
		if (feedImage.getUrl() != null)
			imageDB.append("url", feedImage.getUrl());
		if (feedImage.getTitle() != null)
			imageDB.append("title", feedImage.getTitle());
		if (feedImage.getLink() != null)
			imageDB.append("link", feedImage.getLink());
		if (feedImage.getDescription() != null)
			imageDB.append("description", feedImage.getDescription());
		if (feedImage.getUrl() != null || feedImage.getTitle() != null
				|| feedImage.getLink() != null
				|| feedImage.getDescription() != null)
			feedDB.put("image", imageDB);
		// width does not exist in rome library
		// height does not exist in rome library
	}
	// rating does not exist in rome library
	// text input does not exist in rome library
	// skip hours does not exist in rome library
	// skip days does not exist in rome library

	rssColl.update(new BasicDBObject("feedUrl", feedDB.get("feedUrl")),
			feedDB);
}
 
开发者ID:jeryini,项目名称:distributed-rss,代码行数:75,代码来源:RSSThreadWorker.java


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