• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SyndPerson类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndPerson的典型用法代码示例。如果您正苦于以下问题:Java SyndPerson类的具体用法?Java SyndPerson怎么用?Java SyndPerson使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SyndPerson类属于com.sun.syndication.feed.synd包,在下文中一共展示了SyndPerson类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAuthors

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getAuthors() {
    List<SyndPerson> authors = super.getAuthors();
    List<SyndPerson> result = new ArrayList<SyndPerson>(authors.size());
    for (SyndPerson p : authors) {
        SyndPerson pp = new SyndPersonImpl();
        if (p != null) {
            pp.setEmail(removeInvalidChars(p.getEmail()));
            pp.setName(removeInvalidChars(p.getName()));
            pp.setModules(p.getModules());
            pp.setUri(removeInvalidChars(p.getUri()));
        }
        result.add(pp);
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:18,代码来源:ExtendedSyndEntryImpl.java


示例2: getContributors

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getContributors() {
    List<SyndPerson> contributors = super.getContributors();
    ArrayList<SyndPerson> result = new ArrayList<SyndPerson>();
    for (SyndPerson p : contributors) {
        SyndPersonImpl pp = new SyndPersonImpl();
        if (p != null) {
            pp.setEmail(removeInvalidChars(p.getEmail()));
            pp.setUri(removeInvalidChars(p.getUri()));
            pp.setName(removeInvalidChars(p.getName()));
            pp.setModules(p.getModules());
        }
        result.add(pp);

    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:19,代码来源:ExtendedSyndEntryImpl.java


示例3: createRealFeed

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的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


示例4: getAuthors

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
/**
 * Returns a list of authors for feed or entry.
 * 
 * @param authors
 * @return
 */
private static ArrayList<BasicDBObject> getAuthors(
		ArrayList<SyndPerson> authors) {
	ArrayList<BasicDBObject> authorsDB = new ArrayList<BasicDBObject>();
	for (SyndPerson author : authors) {
		BasicDBObject authorDB = new BasicDBObject();

		if (author.getName() != null)
			authorDB.append("name", author.getName());
		if (author.getUri() != null)
			authorDB.append("uri", author.getUri());
		if (author.getName() != null || author.getUri() != null)
			authorsDB.add(authorDB);
	}

	return authorsDB;
}
 
开发者ID:jeryini,项目名称:distributed-rss,代码行数:23,代码来源:RSSThreadWorker.java


示例5: buildStringList

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
private List<String> buildStringList(List<?> lstConvert) {
	List<String> lstRC = new ArrayList<String>();
	if (lstConvert.isEmpty()) {
		return lstRC;
	}
	for (Object objX : lstConvert) {
		if (objX instanceof SyndPerson) {
			lstRC.add(((SyndPerson) objX).getName());
		} else if (objX instanceof SyndContentImpl) {
			lstRC.add(((SyndContentImpl) objX).getValue());
		} else if (objX instanceof SyndCategoryImpl) {
			lstRC.add(((SyndCategoryImpl) objX).getName());
		} else {
			lstRC.add(objX.toString());
		}
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:19,代码来源:FeedReaderService.java


示例6: setAuthors

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@Override
public void setAuthors(List<String> authors) {
    if ((authors == null) || (authors.size() == 0)) {
        syndEntry.setAuthor(null);
    } else if ((authors.size() > 1) && "atom_1.0".equals(getRssFormat())) {
        // Only Atom 1.0 in Rome supports multiple item authors
        List<SyndPerson> syndPersons = new ArrayList<SyndPerson>();
        for (Iterator<String> iterator = authors.iterator(); iterator.hasNext(); ) {
            String author = iterator.next();
            SyndPerson syndPerson = new SyndPersonImpl();
            syndPerson.setName(author);
            syndPersons.add(syndPerson);
        }
        syndEntry.setAuthors(syndPersons);
    } else {
        if (authors.size() > 1) {
            log.warn("Rome does not support multiple item authors. Using the first author.");
        }
        syndEntry.setAuthor(authors.get(0));
    }
}
 
开发者ID:cert-se,项目名称:megatron-java,代码行数:22,代码来源:RomeRssItem.java


示例7: setAuthors

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@Override
public void setAuthors(List<String> authors) {
    if ((authors == null) || (authors.size() == 0)) {
        syndFeed.setAuthor(null);
    } else if ((authors.size() > 1) && "atom_1.0".equals(getRssFormat())) {
        // Only Atom 1.0 in Rome supports multiple channel authors
        List<SyndPerson> syndPersons = new ArrayList<SyndPerson>();
        for (Iterator<String> iterator = authors.iterator(); iterator.hasNext(); ) {
            String author = iterator.next();
            SyndPerson syndPerson = new SyndPersonImpl();
            syndPerson.setName(author);
            syndPersons.add(syndPerson);
        }
        syndFeed.setAuthors(syndPersons);
    } else {
        if (authors.size() > 1) {
            log.warn("Rome does not support multiple channel authors. Using the first author.");
        }
        syndFeed.setAuthor(authors.get(0));
    }
}
 
开发者ID:cert-se,项目名称:megatron-java,代码行数:22,代码来源:RomeRssChannel.java


示例8: createRealFeed

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的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


示例9: createAtomPersons

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createAtomPersons(List sPersons) {
    List persons = new ArrayList();
    for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) {
        SyndPerson sPerson = (SyndPerson)iter.next();
        Person person = new Person();
        person.setName(sPerson.getName());
        person.setUri(sPerson.getUri());
        person.setEmail(sPerson.getEmail());
        persons.add(person);
    }
    return persons;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:ConverterForAtom03.java


示例10: createSyndPersons

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createSyndPersons(List aPersons) {
    List persons = new ArrayList();
    for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) {
        Person aPerson = (Person)iter.next();
        SyndPerson person = new SyndPersonImpl();
        person.setName(aPerson.getName());
        person.setUri(aPerson.getUri());
        person.setEmail(aPerson.getEmail());
        persons.add(person);
    }
    return persons;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:ConverterForAtom03.java


示例11: makeEntryFromRSSCorrespon

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
/**
 * コレポンからRSSのエントリー(それぞれのItem)を作成.
 */
private SyndEntry makeEntryFromRSSCorrespon(
    RSSCorrespon c, String baseURL) {
    if (log.isDebugEnabled()) {
        log.debug("id[{}]", c.getId());
    }
    SyndEntry entry = new ExtendedSyndEntryImpl();

    // title設定
    entry.setTitle(c.getSubject());
    // description設定
    entry.setDescription(makeDescriptionFromRSSCorrespon(c, baseURL));
    // link(とguid)設定
    entry.setLink(baseURL + "correspon/correspon.jsf?id=" + c.getId()
            + "&projectId=" + c.getProjectId());
    // author設定
    SyndPerson author = new SyndPersonImpl();
    author.setEmail(c.getProjectId() + " : " + c.getProjectNameE());
    List<SyndPerson> authors = new ArrayList<SyndPerson>();
    authors.add(author);
    entry.setAuthors(authors);
    // category設定
    SyndCategory category = new SyndCategoryImpl();
    category.setName(c.getCategory().getLabel());
    List<SyndCategory> categories = new ArrayList<SyndCategory>();
    categories.add(category);
    entry.setCategories(categories);
    // pubDate(とdc:date)設定
    entry.setPublishedDate(c.getUpdatedAt());

    return entry;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:35,代码来源:RSSServiceImpl.java


示例12: createAtomPersons

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createAtomPersons(List sPersons) {
    List persons = new ArrayList();
    for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) {
        SyndPerson sPerson = (SyndPerson)iter.next();
        Person person = new Person();
        person.setName(sPerson.getName());
        person.setUri(sPerson.getUri());
        person.setEmail(sPerson.getEmail());
        person.setModules(sPerson.getModules());
        persons.add(person);
    }
    return persons;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:14,代码来源:ConverterForAtom03.java


示例13: createSyndPersons

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createSyndPersons(List aPersons) {
    List persons = new ArrayList();
    for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) {
        Person aPerson = (Person)iter.next();
        SyndPerson person = new SyndPersonImpl();
        person.setName(aPerson.getName());
        person.setUri(aPerson.getUri());
        person.setEmail(aPerson.getEmail());
        person.setModules(aPerson.getModules());
        persons.add(person);
    }
    return persons;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:14,代码来源:ConverterForAtom03.java


示例14: feedUpdate

import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的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.SyndPerson类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EmpiricalDistribution类代码示例发布时间:2022-05-22
下一篇:
Java InMemoryFormat类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap